From bbeca236b54aa42b343b717d5039dc6bd02340ce Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Sun, 1 Nov 2020 10:58:44 +0800 Subject: 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 --- cmake/QtFlagHandlingHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- cgit v1.2.3