Skip to content

Commit 4e7d311

Browse files
authored
Merge pull request #63067 from compnerd/demanding-order
build: avoid use of `-external:I` on Windows
2 parents 294a91f + 9cbaafb commit 4e7d311

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

stdlib/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
# standard library from the Swift compiler build.
66
project(swift-stdlib LANGUAGES C CXX)
77

8+
# CMake passes `-external:I` to clang-cl which results in the search order being
9+
# altered, and this impacts the definitions of the intrinsics. When building
10+
# with a MSVC toolset 19.29.30036.3 or newer, this will prevent the runtime from
11+
# being built on Windows. Since we know that we only support `clang-cl` as the
12+
# compiler for the runtime due to the use of the Swift calling convention, we
13+
# simply override the CMake behaviour unconditionally.
14+
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
15+
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
16+
817
# Add path for custom CMake modules.
918
list(APPEND CMAKE_MODULE_PATH
1019
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

0 commit comments

Comments
 (0)