Skip to content

Commit 36b186c

Browse files
authored
build: tweak flags further
Because we know that we are building the standard library which requires clang (or clang-cl) due to the use of the Swift calling convention, we can use the `-Isystem` flag to indicate that the headers are system headers and should not generate warnings. This is important as there are uses of anonymous unions and structs in the Windows headers which will trigger warnings which are treated as errors and thus break the build.
1 parent 3fd895a commit 36b186c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ project(swift-stdlib LANGUAGES C CXX)
1111
# being built on Windows. Since we know that we only support `clang-cl` as the
1212
# compiler for the runtime due to the use of the Swift calling convention, we
1313
# simply override the CMake behaviour unconditionally.
14-
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
15-
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
14+
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-Isystem")
15+
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-Isystem")
1616

1717
# Add path for custom CMake modules.
1818
list(APPEND CMAKE_MODULE_PATH

0 commit comments

Comments
 (0)