From 06061b0e3ce4342b5cbb1c0e6c8d285b524e30f0 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 16 Nov 2018 19:17:45 +0100 Subject: Android: improve clang support Summary: Infer the toolchain we are using through cmake's detection of ranlib instead of asking the user to fill it. It's only used in androiddeployqt and cmake expects it to be version "clang" for clang builds while androiddeployqt expects it to be "4.9". Reviewers: #build_system, #android, vkrause Reviewed By: #android, vkrause Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D16930 --- toolchain/specifydependencies.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'toolchain/specifydependencies.cmake') diff --git a/toolchain/specifydependencies.cmake b/toolchain/specifydependencies.cmake index 9cab3f2d..942e88e2 100644 --- a/toolchain/specifydependencies.cmake +++ b/toolchain/specifydependencies.cmake @@ -51,7 +51,13 @@ endif() file(READ "${INPUT_FILE}" CONTENTS) file(READ "stl" stl_contents) -string(REPLACE "##EXTRALIBS##" "${extralibs}" NEWCONTENTS "${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}") +string(REPLACE "##EXTRALIBS##" "${extralibs}" NEWCONTENTS "${NEWCONTENTS}") string(REPLACE "##EXTRAPLUGINS##" "${extraplugins}" NEWCONTENTS "${NEWCONTENTS}") string(REPLACE "##CMAKE_CXX_STANDARD_LIBRARIES##" "${stl_contents}" NEWCONTENTS "${NEWCONTENTS}") file(WRITE "${OUTPUT_FILE}" ${NEWCONTENTS}) -- cgit v1.2.1