diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-08-12 15:55:47 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-08-17 01:36:22 +0000 |
commit | b43afd5315dc8f78bda4331a66886ca61a3e8dce (patch) | |
tree | 38b34b43d3d6bf30c420fe9f812906f7b9f060bf /cmake | |
parent | 6ef3d070a8bad0cfba98fa241a8676401f21371f (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.
Pick-to: 6.2
Fixes: QTBUG-95652
Change-Id: I3154b6c0bb2f53533306227074b24fbbf5973b05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
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}) |