summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-08-12 15:55:47 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-17 02:02:17 +0000
commitfb3be5425785599aef159ddda610ad443f778352 (patch)
tree00ba5cad1fc4867540baba87f1dfb17d3bd9a638 /cmake
parent6fb7f3de3bebcb2346feee2915f2239ab4854df2 (diff)
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. Fixes: QTBUG-95652 Change-Id: I3154b6c0bb2f53533306227074b24fbbf5973b05 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b43afd5315dc8f78bda4331a66886ca61a3e8dce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtFeature.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake
index e069dad23d..6fa6cb43ba 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})