Merge pull request #78774 from compnerd/unknown-silence

build: silence C4067 on Windows (NFCI)
This commit is contained in:
Saleem Abdulrasool
2025-01-22 08:26:16 -08:00
committed by GitHub

View File

@@ -327,9 +327,15 @@ macro(swift_common_cxx_warnings)
# dynamic libraries with this flag.
check_cxx_compiler_flag("-fapplication-extension" CXX_SUPPORTS_FAPPLICATION_EXTENSION)
# Disable C4068: unknown pragma. This means that MSVC doesn't report hundreds of warnings across
# the repository for IDE features such as #pragma mark "Title".
# Disable C4067: expected tokens following preprocessor directive - expected a
# newline.
#
# Disable C4068: unknown pragma.
#
# This means that MSVC doesn't report hundreds of warnings across the
# repository for IDE features such as #pragma mark "Title".
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/wd4067>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/wd4068>)
check_cxx_compiler_flag("/permissive-" CXX_SUPPORTS_PERMISSIVE_FLAG)