summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-04-03 14:23:18 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-04-03 21:51:06 +0200
commit430232e44d5e6c7d7fd7ca3ebebb06d74e21ce2f (patch)
treea5e2f6e636ef33a6f58ead2cda88b5720996606f /cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
parent91218299166942548cd0c1776d391f565249b112 (diff)
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/QtBuildInternals/QtBuildInternalsConfig.cmake')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index cff3abb97b..3265fea7b2 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -65,8 +65,26 @@ macro(qt_build_internals_set_up_private_api)
qt_check_if_tools_will_be_built()
endmacro()
+macro(qt_enable_cmake_languages)
+ include(CheckLanguage)
+ set(__qt_required_language_list C CXX)
+ set(__qt_optional_language_list OBJC OBJCXX)
+
+ foreach(__qt_lang ${__qt_required_language_list})
+ enable_language(${__qt_lang})
+ endforeach()
+
+ foreach(__qt_lang ${__qt_optional_language_list})
+ check_language(${__qt_lang})
+ if(CMAKE_${__qt_lang}_COMPILER)
+ enable_language(${__qt_lang})
+ endif()
+ endforeach()
+endmacro()
+
macro(qt_build_repo_begin)
qt_build_internals_set_up_private_api()
+ qt_enable_cmake_languages()
# Add global docs targets that will work both for per-repo builds, and super builds.
if(NOT TARGET docs)