summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2020-11-01 10:58:44 +0800
committerYuhang Zhao <2546789017@qq.com>2020-11-01 10:59:29 +0000
commitbbeca236b54aa42b343b717d5039dc6bd02340ce (patch)
treec4b1d1675b557a4737c05ef9544d83ac0d69e239
parent40495ce75cb36a5bc750e8ef2df4473534586a81 (diff)
Fix compilation error on Windows
When linking static libraries, MSVC's link.exe complains about the unknown parameter "/INCREMENTAL:NO" and output a lot of warning messages about this. This doesn't happen when it's linking exes or dlls. The situation is a lot more worse when we are using clang-cl. clang-cl will print some error message like it can't find a file named "/INCREMENTAL:NO" and just stop compiling. It seems clang-cl treat unknown parameters as input files. Fixes: QTBUG-87875 Change-Id: I37ed29de082b0258e81494db54f275417ab42708 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index 685c1616b7..2b6430a229 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -827,7 +827,7 @@ function(qt_internal_set_up_config_optimizations_like_in_qmake)
qt_internal_add_linker_flags(
FLAGS "${flag_value}"
CONFIGS RELEASE RELWITHDEBINFO MINSIZEREL
- TYPES ${target_link_types}
+ TYPES EXE SHARED # when linking static libraries, link.exe can't recognize this parameter, clang-cl will error out.
IN_CACHE)
endif()