Skip to content

Commit 4a54598

Browse files
authored
Merge pull request #83699 from compnerd/include
build: adjust the system include directory flag for Windows
2 parents 2215a51 + cf2993c commit 4a54598

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stdlib/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ 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 "-Isystem")
15-
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-Isystem")
14+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
15+
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-imsvc ")
16+
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-imsvc ")
17+
else()
18+
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-Isystem")
19+
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-Isystem")
20+
endif()
1621

1722
# Add path for custom CMake modules.
1823
list(APPEND CMAKE_MODULE_PATH

0 commit comments

Comments
 (0)