diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-08-21 08:40:54 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-08-23 11:04:42 +0200 |
commit | 48cf015906e34ea0f8a388fd3a0e53ec082546f2 (patch) | |
tree | 44160036aa348732dadadd7a865b56d4c6df6e6d /cmake/QtFlagHandlingHelpers.cmake | |
parent | c8fda317ea12914ee51c20fe8bd256454cdb6cfe (diff) |
CMake: Implement configure -optimize-size
This configure switch controls the feature 'optimize_size'.
This isn't merely a mapping to CMAKE_BUILD_TYPE=MinSizeRel, because
we potentially want to combine -optimize-size with -force-debug-info,
which maps to CMAKE_BUILD_CONFIG=RelWithDebInfo.
Task-number: QTBUG-85373
Change-Id: I1a9343ebc54816f52e90e9d33ea3df4c99b1ec9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtFlagHandlingHelpers.cmake')
-rw-r--r-- | cmake/QtFlagHandlingHelpers.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index 29453e2943..b305bc6b2f 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -361,6 +361,11 @@ function(qt_internal_set_up_config_optimizations_like_in_qmake) string(APPEND "${flag_var_name}" " ${QT_CFLAGS_OPTIMIZE_DEBUG}") endif() + set(configs_for_optimize_size RELEASE RELWITHDEBINFO) + if(QT_FEATURE_optimize_size AND config IN_LIST configs_for_optimize_size) + string(APPEND "${flag_var_name}" " ${QT_CFLAGS_OPTIMIZE_SIZE}") + endif() + # Assign value to the cache entry. get_property(help_text CACHE "${flag_var_name}" PROPERTY HELPSTRING) set("${flag_var_name}" "${${flag_var_name}}" CACHE STRING "${help_text}" FORCE) |