@@ -156,12 +156,12 @@ if(WIN32)
156
156
# See: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/.
157
157
list (APPEND CMAKE_VS_GLOBALS "UseMultiToolTask=true" )
158
158
159
- try_append_cxx_flags("/W3" TARGET core_interface)
160
- try_append_cxx_flags("/wd4018" TARGET core_interface)
161
- try_append_cxx_flags("/wd4244" TARGET core_interface)
162
- try_append_cxx_flags("/wd4267" TARGET core_interface)
163
- try_append_cxx_flags("/wd4715" TARGET core_interface)
164
- try_append_cxx_flags("/wd4805" TARGET core_interface)
159
+ try_append_cxx_flags("/W3" TARGET core_interface SKIP_LINK )
160
+ try_append_cxx_flags("/wd4018" TARGET core_interface SKIP_LINK )
161
+ try_append_cxx_flags("/wd4244" TARGET core_interface SKIP_LINK )
162
+ try_append_cxx_flags("/wd4267" TARGET core_interface SKIP_LINK )
163
+ try_append_cxx_flags("/wd4715" TARGET core_interface SKIP_LINK )
164
+ try_append_cxx_flags("/wd4805" TARGET core_interface SKIP_LINK )
165
165
target_compile_definitions (core_interface INTERFACE
166
166
_CRT_SECURE_NO_WARNINGS
167
167
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
@@ -176,7 +176,7 @@ if(WIN32)
176
176
)
177
177
# Avoid the use of aligned vector instructions when building for Windows.
178
178
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412.
179
- try_append_cxx_flags("-Wa,-muse-unaligned-vector-move" TARGET core_interface)
179
+ try_append_cxx_flags("-Wa,-muse-unaligned-vector-move" TARGET core_interface SKIP_LINK )
180
180
try_append_linker_flag("-static" TARGET core_interface)
181
181
# We require Windows 7 (NT 6.1) or later.
182
182
try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface)
@@ -221,6 +221,7 @@ if(SANITIZERS)
221
221
# fail if a bad argument is passed, e.g. -fsanitize=undfeined
222
222
try_append_cxx_flags("-fsanitize=${SANITIZERS} " TARGET sanitizing_interface
223
223
RESULT_VAR cxx_supports_sanitizers
224
+ SKIP_LINK
224
225
)
225
226
if (NOT cxx_supports_sanitizers)
226
227
message (FATAL_ERROR "Compiler did not accept requested flags." )
@@ -320,7 +321,7 @@ if(HARDENING)
320
321
$<$<NOT :$<CONFIG:Debug>>:-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3>
321
322
)
322
323
323
- try_append_cxx_flags("-Wstack-protector" TARGET hardening_interface)
324
+ try_append_cxx_flags("-Wstack-protector" TARGET hardening_interface SKIP_LINK )
324
325
try_append_cxx_flags("-fstack-protector-all" TARGET hardening_interface)
325
326
try_append_cxx_flags("-fcf-protection=full" TARGET hardening_interface)
326
327
@@ -362,7 +363,7 @@ if(WERROR)
362
363
else ()
363
364
set (werror_flag "-Werror" )
364
365
endif ()
365
- try_append_cxx_flags(${werror_flag} TARGET core_interface RESULT_VAR compiler_supports_werror)
366
+ try_append_cxx_flags(${werror_flag} TARGET core_interface RESULT_VAR compiler_supports_werror SKIP_LINK )
366
367
if (NOT compiler_supports_werror)
367
368
message (FATAL_ERROR "WERROR set but ${werror_flag} is not usable." )
368
369
endif ()
0 commit comments