aboutsummaryrefslogtreecommitdiff
path: root/toolchain/specifydependencies.cmake
diff options
context:
space:
mode:
authorSharaf Zaman <sharafzaz121@gmail.com>2020-10-21 12:23:06 +0000
committerSharaf Zaman <sharafzaz121@gmail.com>2020-10-21 14:54:31 +0000
commit0dc7bd82b03387183bb389ffbd5a28876ba3ed31 (patch)
tree0ea44a47a68f8ec2d830d690760d33c3c1ef2dea /toolchain/specifydependencies.cmake
parente3dd0a50689620c0ecbfc722cd9e9c9aabe6d63d (diff)
downloadextra-cmake-modules-0dc7bd82b03387183bb389ffbd5a28876ba3ed31.tar.gz
extra-cmake-modules-0dc7bd82b03387183bb389ffbd5a28876ba3ed31.tar.bz2
Include option to use LLVM for users with Qt < 5.14
When NDK r20+ is used along with Qt5.12, APK generation fails because of the layout change in newer NDK. This patch introduces a new variable USE_LLVM, when this is set for older Qt versions, androiddeployqt uses LLVM's tools.
Diffstat (limited to 'toolchain/specifydependencies.cmake')
-rw-r--r--toolchain/specifydependencies.cmake15
1 files changed, 12 insertions, 3 deletions
diff --git a/toolchain/specifydependencies.cmake b/toolchain/specifydependencies.cmake
index d21250c1..905b62c3 100644
--- a/toolchain/specifydependencies.cmake
+++ b/toolchain/specifydependencies.cmake
@@ -73,9 +73,18 @@ file(READ "stl" stl_contents)
file(READ "ranlib" ranlib_contents)
string(REGEX MATCH ".+/toolchains/(.+)-([^\\-]+)/prebuilt/.*/bin/(.*)-ranlib" x ${ranlib_contents})
-string(REPLACE "##ANDROID_TOOL_PREFIX##" "${CMAKE_MATCH_1}" NEWCONTENTS "${CONTENTS}")
-string(REPLACE "##ANDROID_TOOLCHAIN_VERSION##" "${CMAKE_MATCH_2}" NEWCONTENTS "${NEWCONTENTS}")
-string(REPLACE "##ANDROID_COMPILER_PREFIX##" "${CMAKE_MATCH_3}" NEWCONTENTS "${NEWCONTENTS}")
+if (USE_LLVM)
+ string(REPLACE "##ANDROID_TOOL_PREFIX##" "llvm" NEWCONTENTS "${CONTENTS}")
+ string(REPLACE "##ANDROID_COMPILER_PREFIX##" "llvm" NEWCONTENTS "${NEWCONTENTS}")
+ string(REPLACE "##USE_LLVM##" true NEWCONTENTS "${NEWCONTENTS}")
+else()
+ string(REPLACE "##ANDROID_TOOL_PREFIX##" "${CMAKE_MATCH_1}" NEWCONTENTS "${CONTENTS}")
+ string(REPLACE "##ANDROID_COMPILER_PREFIX##" "${CMAKE_MATCH_3}" NEWCONTENTS "${NEWCONTENTS}")
+ string(REPLACE "##USE_LLVM##" false NEWCONTENTS "${NEWCONTENTS}")
+endif()
+
+string(REPLACE "##ANDROID_TOOLCHAIN_VERSION##" "${CMAKE_MATCH_2}" NEWCONTENTS "${NEWCONTENTS}") # not used when USE_LLVM is set
+
string(REPLACE "##EXTRALIBS##" "${extralibs}" NEWCONTENTS "${NEWCONTENTS}")
string(REPLACE "##EXTRAPLUGINS##" "${extraplugins}" NEWCONTENTS "${NEWCONTENTS}")
string(REPLACE "##CMAKE_CXX_STANDARD_LIBRARIES##" "${stl_contents}" NEWCONTENTS "${NEWCONTENTS}")