Skip to content

Commit ce0c057

Browse files
authored
Merge pull request #78778 from compnerd/checked-build
build: only add compiler flag if it is supported
2 parents 7903bf2 + c9e4dff commit ce0c057

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)