From e425a2a4b8dd469920eede57e9c4094523aa9ad7 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 20 Jan 2021 19:34:26 +0100 Subject: 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 --- cmake/QtInternalTargets.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmake/QtInternalTargets.cmake') diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 4ed2f1c21a..97386e22d8 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -149,6 +149,11 @@ endif() if(WIN32) target_compile_definitions(PlatformCommonInternal INTERFACE "UNICODE;_UNICODE") + if(MSVC) + target_compile_definitions(PlatformCommonInternal INTERFACE + "$<$,SHARED_LIBRARY>:_WINDLL>" + ) + endif() endif() if(UIKIT) -- cgit v1.2.3