Skip to content

Commit 901b73e

Browse files
authored
Merge pull request swiftlang#7450 from hughbe/cleanup-compiler-flags
Fix potentially appending "/wd4068" on mac builds
2 parents 863dfca + 46ccacd commit 901b73e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ macro(swift_common_cxx_warnings)
290290

291291
# Disable C4068: unknown pragma. This means that MSVC doesn't report hundreds of warnings across
292292
# the repository for IDE features such as #pragma mark "Title".
293-
check_cxx_compiler_flag("/wd4068" CXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG)
294-
append_if(CXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG "/wd4068" CMAKE_CXX_FLAGS)
293+
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
294+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068")
295+
endif()
295296
endmacro()
296297

297298
# Like 'llvm_config()', but uses libraries from the selected build

0 commit comments

Comments
 (0)