Skip to content

Commit 6b58947

Browse files
committed
build: silence C4067 on Windows (NFCI)
This silences a warning that the MSVC compiler emits about unknown pragmas. This helps clear up the build a small amount so real issues do not get hidden.
1 parent cc9713b commit 6b58947

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,15 @@ macro(swift_common_cxx_warnings)
325325
# dynamic libraries with this flag.
326326
check_cxx_compiler_flag("-fapplication-extension" CXX_SUPPORTS_FAPPLICATION_EXTENSION)
327327

328-
# Disable C4068: unknown pragma. This means that MSVC doesn't report hundreds of warnings across
329-
# the repository for IDE features such as #pragma mark "Title".
328+
# Disable C4067: expected tokens following preprocessor directive - expected a
329+
# newline.
330+
#
331+
# Disable C4068: unknown pragma.
332+
#
333+
# This means that MSVC doesn't report hundreds of warnings across the
334+
# repository for IDE features such as #pragma mark "Title".
330335
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
336+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/wd4067>)
331337
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/wd4068>)
332338

333339
check_cxx_compiler_flag("/permissive-" CXX_SUPPORTS_PERMISSIVE_FLAG)

0 commit comments

Comments
 (0)