Skip to content

Commit c9e4dff

Browse files
committed
build: only add compiler flag if it is supported
This ensures that we only add the flag if it is supported by the compiler rather than doing it unconditionally.
1 parent cc9713b commit c9e4dff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ macro(swift_common_cxx_warnings)
295295

296296
if(MSVC)
297297
check_cxx_compiler_flag("/we4062" CXX_SUPPORTS_WE4062)
298-
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/we4062>)
298+
if(CXX_SUPPORTS_WE4062)
299+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/we4062>)
300+
endif()
299301
endif()
300302
endif()
301303

0 commit comments

Comments
 (0)