Skip to content

Commit 7fb323c

Browse files
committed
[CMake] Don't export module map for Windows after the first installed SDK arch, as unneeded after swiftlang/swift#79621
1 parent 081798c commit 7fb323c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ set(COLLECTIONS_SINGLE_MODULE YES)
6464
set(COLLECTIONS_FOUNDATION_TOOLCHAIN_MODULE YES)
6565

6666
set(SwiftFoundation_MACRO "" CACHE STRING "Path to Foundation macro plugin")
67+
set(BUILT_FIRST_SDK NO CACHE BOOL "Whether an SDK has already been built and we can use its headers")
6768

6869
# Make sure our dependencies exists
6970
include(FetchContent)

Sources/_FoundationCShims/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ add_library(_FoundationCShims STATIC
1717
string_shims.c
1818
uuid.c)
1919

20-
target_include_directories(_FoundationCShims PUBLIC include)
2120

22-
target_compile_options(_FoundationCShims INTERFACE
23-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/module.modulemap>")
21+
if(NOT BUILT_FIRST_SDK)
22+
target_include_directories(_FoundationCShims PUBLIC include)
23+
24+
target_compile_options(_FoundationCShims INTERFACE
25+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/module.modulemap>")
26+
endif()
2427

2528
set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS _FoundationCShims)
2629

0 commit comments

Comments
 (0)