From 8a5ffc4f73ef250610836393d0b71b2861a04929 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 17 Apr 2020 08:39:47 +0200 Subject: CMake: Port the 'ltcg' feature This maps to the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION. Change-Id: Id0ce48f176b95c27e74ab80276e89503b1660f79 Reviewed-by: Alexandru Croitor --- configure.cmake | 6 ++++++ util/cmake/configurejson2cmake.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.cmake b/configure.cmake index 5534f6aafc..f67dd96b6e 100644 --- a/configure.cmake +++ b/configure.cmake @@ -509,6 +509,12 @@ qt_feature("precompile_header" CONDITION BUILD_WITH_PCH ) qt_feature_config("precompile_header" QMAKE_PRIVATE_CONFIG) +qt_feature("ltcg" + LABEL "Using LTCG" + AUTODETECT 1 + CONDITION CMAKE_INTERPROCEDURAL_OPTIMIZATION +) +qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG) qt_feature("reduce_exports" PRIVATE LABEL "Reduce amount of exported symbols" CONDITION NOT WIN32 AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index a756d8d5e7..90bd3e2af6 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -852,7 +852,10 @@ def get_feature_mapping(): "condition": "NOT QT_FEATURE_icu AND QT_FEATURE_textcodec AND ( TEST_posix_iconv OR TEST_sun_iconv )" }, "incredibuild_xge": None, - "ltcg": None, + "ltcg": { + "autoDetect": "1", + "condition": "CMAKE_INTERPROCEDURAL_OPTIMIZATION" + }, "msvc_mp": None, "optimize_debug": None, "optimize_size": None, -- cgit v1.2.3