diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-04-03 14:23:18 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-04-03 21:51:06 +0200 |
commit | 430232e44d5e6c7d7fd7ca3ebebb06d74e21ce2f (patch) | |
tree | a5e2f6e636ef33a6f58ead2cda88b5720996606f /cmake/QtAutoDetect.cmake | |
parent | 91218299166942548cd0c1776d391f565249b112 (diff) | |
download | qtbase-430232e44d5e6c7d7fd7ca3ebebb06d74e21ce2f.tar.gz |
CMake: Adjust PCH support for multi-arch iOS builds
Starting with CMake 3.18, there is PCH support for darwin multi-arch
builds, like iOS simulator_and_device builds.
Also enable PCH for Objective-C++ files when the support is there.
To enable PCH for Objective-C++, we need to do enable the OBJCXX
language as well, but conditionally, because on non-darwin platforms
the language is probably not available.
Introduce the qt_enable_cmake_languages() macro which is called
automatically by qt_build_repo_begin().
Change-Id: I0e7f44be6577ac54ce940470036626409920e272
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtAutoDetect.cmake')
-rw-r--r-- | cmake/QtAutoDetect.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmake/QtAutoDetect.cmake b/cmake/QtAutoDetect.cmake index 6f06c48984..d5d93007ba 100644 --- a/cmake/QtAutoDetect.cmake +++ b/cmake/QtAutoDetect.cmake @@ -205,10 +205,10 @@ endfunction() function(qt_auto_detect_pch) set(default_value "ON") - if(CMAKE_OSX_ARCHITECTURES) + if(CMAKE_OSX_ARCHITECTURES AND CMAKE_VERSION VERSION_LESS 3.18.0 AND NOT QT_FORCE_PCH) list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count) - # CMake doesn't currently support PCH when multiple architecture are set. This is the - # case for simulator_and_device builds. + # CMake versions lower than 3.18 don't support PCH when multiple architectures are set. + # This is the case for simulator_and_device builds. if(arch_count GREATER 1) set(default_value "OFF") message(WARNING "PCH support disabled due to usage of multiple architectures.") |