From b43afd5315dc8f78bda4331a66886ca61a3e8dce Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 12 Aug 2021 15:55:47 +0200 Subject: CMake: Make precompiled headers work for Android on Windows When building Qt for Android on Windows, the precompile_headers test failed if the source directory was passed as absolute path without drive letter. See CMake upstream issue #22534. Work around the CMake issue by ensuring that the path is properly prefixed with a drive letter. Pick-to: 6.2 Fixes: QTBUG-95652 Change-Id: I3154b6c0bb2f53533306227074b24fbbf5973b05 Reviewed-by: Alexandru Croitor --- cmake/QtFeature.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmake') diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 21f84f8e20..576dc27b85 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -863,6 +863,15 @@ function(qt_config_compile_test name) set(arg_CMAKE_FLAGS "") endif() + # CI passes the project dir of the Qt repository as absolute path without drive letter: + # \Users\qt\work\qt\qtbase + # Ensure that arg_PROJECT_PATH is an absolute path with drive letter: + # C:/Users/qt/work/qt/qtbase + # This works around CMake upstream issue #22534. + if(CMAKE_HOST_WIN32) + get_filename_component(arg_PROJECT_PATH "${arg_PROJECT_PATH}" REALPATH) + endif() + try_compile(HAVE_${name} "${CMAKE_BINARY_DIR}/config.tests/${name}" "${arg_PROJECT_PATH}" "${name}" CMAKE_FLAGS ${flags} ${arg_CMAKE_FLAGS}) -- cgit v1.2.3