From 430232e44d5e6c7d7fd7ca3ebebb06d74e21ce2f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 3 Apr 2020 14:23:18 +0200 Subject: 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 Reviewed-by: Alexandru Croitor --- cmake/QtAutoDetect.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmake/QtAutoDetect.cmake') 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.") -- cgit v1.2.1