Find C++ shared lib path using regex. This change makes finding path
independent of the order in which it was added by cmake.
Details
- Reviewers
apol - Commits
- R240:307b36662ec9: Bug fix: find c++ stl using regex
Diff Detail
- Repository
- R240 Extra CMake Modules
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Can we add a cmake_minimum_required to 3.7? Regex fails to compile on older versions, when run outside of Android.cmake.
Why are you using it without Android.cmake?
I am building Krita and to add create-apk target I am using include (ECMAndroidDeployQt.cmake), I can't use Android.cmake because of some variables as it expects to run as a toolchain.
Later today, I will submit the patch for Krita which you might have to review :-)
What does it mean that "it expects to run as a toolchain"?
toolchain/ECMAndroidDeployQt.cmake | ||
---|---|---|
43 | This looks quite awful. Why do you prefer using regex to string(FIND)? It could be something like |
toolchain/ECMAndroidDeployQt.cmake | ||
---|---|---|
43 | Because string (FIND ..) doesn't work if libc++.so isn't added first to CMAKE_CXX_STANDARD_LIBRARIES In my case this is the original value of CMAKE_CXX_STANDARD_LIBRARIES: -latomic -lm "/home/sh_zam/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a" "/home/sh_zam/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so" and the value written to stl file is the same thing as above, which down the line causes androidqtdeploy to fail. |
What does it mean that "it expects to run as a toolchain"?
Sorry, I didn't notice this.
On this line
get_filename_component(_CMAKE_ANDROID_DIR "${CMAKE_TOOLCHAIN_FILE}" PATH)
we get the path of ECM/toolchain, which is used to include ECMAndroidDeployQt.cmake, which in turn can only be extracted if it is being run as a toolchain.
In my case if I do this: include (Android.cmake), then it won't be able to find the ECMAndroidDeployQt.cmake because I am using android-ndk's toolchain.
And why do you have to do this? Why can't krita work like every other KDE project? In the end we'll want Krita to work in binary-factory.kde.org like the rest...
well.. I couldn't get it running as a toolchain and kept running into errors.
I can give it another hit, though.