Skip to content

Commit d21c339

Browse files
committed
build: sink flag handling into global handling
This shuffles the warning from the unified build only to the global build configuration.
1 parent dba3498 commit d21c339

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,6 @@ macro(swift_common_unified_build_config product)
304304
"${CMARK_BUILD_INCLUDE_DIR}")
305305

306306
include(AddSwiftTableGen) # This imports TableGen from LLVM.
307-
308-
check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
309-
if(CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
310-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types")
311-
endif()
312307
endmacro()
313308

314309
# Common cmake project config for additional warnings.
@@ -337,6 +332,11 @@ macro(swift_common_cxx_warnings)
337332
check_cxx_compiler_flag("-Werror -Woverloaded-virtual" CXX_SUPPORTS_OVERLOADED_VIRTUAL)
338333
append_if(CXX_SUPPORTS_OVERLOADED_VIRTUAL "-Woverloaded-virtual" CMAKE_CXX_FLAGS)
339334

335+
check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
336+
if(CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
337+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types")
338+
endif()
339+
340340
# Check for '-fapplication-extension'. On OS X/iOS we wish to link all
341341
# dynamic libraries with this flag.
342342
check_cxx_compiler_flag("-fapplication-extension" CXX_SUPPORTS_FAPPLICATION_EXTENSION)

0 commit comments

Comments
 (0)