diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index deb5b001e17..dba0b27e984 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -195,7 +195,7 @@ function(qt_internal_add_module target) endif() endif() - if(FEATURE_ltcg AND GCC AND is_static_lib) + if((FEATURE_ltcg OR CMAKE_INTERPROCEDURAL_OPTIMIZATION) AND GCC AND is_static_lib) # CMake <= 3.19 appends -fno-fat-lto-objects for all library types if # CMAKE_INTERPROCEDURAL_OPTIMIZATION is enabled. Static libraries need # the opposite compiler option. diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 5396ba19b8e..680c79ad79f 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -605,7 +605,7 @@ target_sources(Core PRIVATE ${core_version_tagging_files}) # Disable LTO, as the symbols disappear somehow under GCC # (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200) -if(GCC AND FEATURE_ltcg) +if(GCC) set_source_files_properties(${core_version_tagging_files} PROPERTIES COMPILE_OPTIONS "-fno-lto") endif() diff --git a/src/corelib/global/qversiontagging.cpp b/src/corelib/global/qversiontagging.cpp index b5e524bf4c3..a0d15ae8715 100644 --- a/src/corelib/global/qversiontagging.cpp +++ b/src/corelib/global/qversiontagging.cpp @@ -102,7 +102,6 @@ make_versioned_symbol(SYM, QT_VERSION_MAJOR, 14, "@"); make_versioned_symbol(SYM, QT_VERSION_MAJOR, 15, "@"); #endif #if QT_VERSION_MINOR > 16 -// We don't expect there will be a Qt 5.17 # error "Please update this file with more Qt versions." #endif