summaryrefslogtreecommitdiffstats
path: root/cmake/QtModuleHelpers.cmake
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-10-13 09:06:55 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-10-13 18:29:35 -0700
commitdcb281af7dc1a41813300ea74f1890902f6bf748 (patch)
tree758a5b67a4b7572c4d0df061e6df6dbd45b2ce56 /cmake/QtModuleHelpers.cmake
parenta45bc2d12319588d27904f8eb8022d4308b43b63 (diff)
CMake: Make LTO build work
We don't need to check FEATURE_ltcg, just add -fno-lto unconditionally. That makes QtCore compile with -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON. Change-Id: Icb2516126f674e7b8bb3fffd16ada2c71d7334aa Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtModuleHelpers.cmake')
-rw-r--r--cmake/QtModuleHelpers.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake
index deb5b001e1..dba0b27e98 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.