summaryrefslogtreecommitdiffstats
path: root/cmake/QtFlagHandlingHelpers.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-10-05 09:09:13 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-10-06 10:07:08 +0200
commit98bea5857a0b63925ebab160a717105ad6ee9445 (patch)
tree43110370aec654590229a2f77d16e42b754ac767 /cmake/QtFlagHandlingHelpers.cmake
parent07b6d3367debd8f15974abf0f5cdf48f0fe3a536 (diff)
CMake: Introduce CMake-only optimize_full feature
Enabling it will force usage of '-O3' flag when building Qt. If the platform has no '-O3' flag, use '-O2' as a fallback. Task-number: QTBUG-86866 Change-Id: If13f7de954ba5c01dc9634f06a85529828fe90a9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtFlagHandlingHelpers.cmake')
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index db2790171d..4dd37b35f7 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -793,6 +793,15 @@ function(qt_internal_set_up_config_optimizations_like_in_qmake)
set(value_to_append "${QT_CFLAGS_OPTIMIZE_SIZE}")
endif()
+ # Check if the fake 'optimize_full' feature is enabled.
+ # Use the max optimization level flag for all release configs, effectively
+ # overriding any previous setting.
+ set(configs_for_optimize RELEASE RELWITHDEBINFO MINSIZEREL)
+ if(QT_FEATURE_optimize_full AND config IN_LIST configs_for_optimize)
+ qt_internal_get_optimize_full_flags(optimize_full_flags)
+ set(value_to_append "${optimize_full_flags}")
+ endif()
+
# Assign value to the cache entry.
if(value_to_append)
string(APPEND "${flag_var_name}" " ${value_to_append}")