diff options
author | David Faure <faure@kde.org> | 2022-02-27 21:25:14 +0100 |
---|---|---|
committer | David Faure <faure@kde.org> | 2022-03-06 09:36:18 +0000 |
commit | cc882b1cff773c4e97eccd29ca3dae8a5aeb4e52 (patch) | |
tree | 1221c8fa1601fc52562c4fff518b4cf3e19551fc | |
parent | d18d5f38650dc41f801773823bff63ea73694a2f (diff) | |
download | extra-cmake-modules-cc882b1cff773c4e97eccd29ca3dae8a5aeb4e52.tar.gz extra-cmake-modules-cc882b1cff773c4e97eccd29ca3dae8a5aeb4e52.tar.bz2 |
Android: autodetect the use of llvm
-rw-r--r-- | toolchain/specifydependencies.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/toolchain/specifydependencies.cmake b/toolchain/specifydependencies.cmake index 453a7721..fac7c71d 100644 --- a/toolchain/specifydependencies.cmake +++ b/toolchain/specifydependencies.cmake @@ -83,13 +83,16 @@ file(READ "${INPUT_FILE}" CONTENTS) file(READ "stl" stl_contents) file(READ "ranlib" ranlib_contents) -string(REGEX MATCH ".+/toolchains/(.+)-([^\\-]+)/prebuilt/.*/bin/(.*)-ranlib" x ${ranlib_contents}) - +string(REGEX MATCH ".+/toolchains/llvm/prebuilt/.+/bin/(.+)-ranlib" USE_LLVM ${ranlib_contents}) if (USE_LLVM) string(REPLACE "##ANDROID_TOOL_PREFIX##" "llvm" NEWCONTENTS "${CONTENTS}") - string(REPLACE "##ANDROID_COMPILER_PREFIX##" "llvm" NEWCONTENTS "${NEWCONTENTS}") + string(REPLACE "##ANDROID_COMPILER_PREFIX##" "${CMAKE_MATCH_1}" NEWCONTENTS "${NEWCONTENTS}") string(REPLACE "##USE_LLVM##" true NEWCONTENTS "${NEWCONTENTS}") else() + string(REGEX MATCH ".+/toolchains/(.+)-([^\\-]+)/prebuilt/.+/bin/(.+)-ranlib" RANLIB_PATH_MATCH ${ranlib_contents}) + if (NOT RANLIB_PATH_MATCH) + message(FATAL_ERROR "Couldn't parse the components of the path to ${ranlib_contents}") + endif() 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}") |