Skip to content

Commit a43bebb

Browse files
authored
Merge pull request #6885 from hughbe/pragma-msvc
Ignore unknown pragma warnings with MSVC
2 parents dffdaa0 + f446dd0 commit a43bebb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ macro(swift_common_cxx_warnings)
284284
# Check for '-fapplication-extension'. On OS X/iOS we wish to link all
285285
# dynamic libraries with this flag.
286286
check_cxx_compiler_flag("-fapplication-extension" CXX_SUPPORTS_FAPPLICATION_EXTENSION)
287+
288+
# Disable C4068: unknown pragma. This means that MSVC doesn't report hundreds of warnings across
289+
# the repository for IDE features such as #pragma mark "Title".
290+
check_cxx_compiler_flag("/wd4068" CXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG)
291+
append_if(CXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG "/wd4068" CMAKE_CXX_FLAGS)
287292
endmacro()
288293

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

0 commit comments

Comments
 (0)