Tune compilation flags to reduce libraries size
Add '_WINDLL' definition for the MSVC compilers family. Check the 'FEATURE_optimize_size' value before replacing compiler flags in the qt_internal_add_optimize_full_flags function. This is required, because Qt::Core and Qt::Gui modules lost their ability to shrink, when selecting the appropriate build type or features. Fixes: QTBUG-89952 Change-Id: I982c25ea84e4793b4006ead0ee516b3f3eb2a054 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
df0e98d408
commit
e425a2a4b8
@ -593,13 +593,22 @@ function(qt_internal_add_optimize_full_flags)
|
||||
""
|
||||
${ARGN})
|
||||
|
||||
# Assume that FEATURE_optimize_full has higher priority. But if FEATURE_optimize_full is OFF,
|
||||
# flags are set by FEATURE_optimize_size should remain unchanged.
|
||||
if(QT_FEATURE_optimize_size AND NOT QT_FEATURE_optimize_full)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(args "")
|
||||
if(arg_IN_CACHE)
|
||||
list(APPEND args IN_CACHE)
|
||||
endif()
|
||||
|
||||
qt_internal_get_enabled_languages_for_flag_manipulation(enabled_languages)
|
||||
set(configs RELEASE RELWITHDEBINFO MINSIZEREL)
|
||||
set(configs RELEASE RELWITHDEBINFO)
|
||||
if(QT_FEATURE_optimize_full) # Assume that FEATURE_optimize_full has higher priority.
|
||||
list(APPEND configs MINSIZEREL)
|
||||
endif()
|
||||
|
||||
qt_internal_remove_known_optimization_flags(${args} CONFIGS ${configs})
|
||||
|
||||
|
@ -149,6 +149,11 @@ endif()
|
||||
|
||||
if(WIN32)
|
||||
target_compile_definitions(PlatformCommonInternal INTERFACE "UNICODE;_UNICODE")
|
||||
if(MSVC)
|
||||
target_compile_definitions(PlatformCommonInternal INTERFACE
|
||||
"$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:_WINDLL>"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UIKIT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user