Skip to content

Commit 25d7707

Browse files
committed
stdlib: build multiple platform libraries simultaneously
Always construct the platform libraries for all the target SDKs. This enables us to build the right set for targets and will also enable us to cross-compile multiple targets simultaneously.
1 parent 7b67187 commit 25d7707

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

stdlib/public/Platform/CMakeLists.txt

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,21 @@ set(swift_platform_sources
66
TiocConstants.swift
77
tgmath.swift.gyb)
88

9-
if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
10-
set(swift_platform_name swiftDarwin)
11-
set(swift_platform_sources
12-
Darwin.swift
13-
${swift_platform_sources}
14-
POSIXError.swift
15-
MachError.swift)
16-
set(swift_platform_flags
17-
SWIFT_COMPILE_FLAGS -Xfrontend -disable-objc-attr-requires-foundation-module
18-
API_NOTES_NON_OVERLAY)
19-
else()
20-
set(swift_platform_name swiftGlibc)
21-
set(swift_platform_sources
22-
Glibc.swift
23-
${swift_platform_sources})
24-
set(swift_platform_flags
25-
DEPENDS glibc_modulemap)
26-
endif()
9+
add_swift_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
10+
Darwin.swift
11+
${swift_platform_sources}
12+
POSIXError.swift
13+
MachError.swift
14+
15+
SWIFT_COMPILE_FLAGS -Xfrontend -disable-objc-attr-requires-foundation-module
16+
TARGET_SDKS IOS IOS_SIMULATOR OSX TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR
17+
API_NOTES_NON_OVERLAY)
2718

28-
add_swift_library(${swift_platform_name} ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
19+
add_swift_library(swiftGlibc ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
20+
Glibc.swift
2921
${swift_platform_sources}
30-
${swift_platform_flags})
22+
TARGET_SDKS ANDROID CYGWIN FREEBSD LINUX
23+
DEPENDS glibc_modulemap)
3124

3225
set(glibc_modulemap_target_list)
3326
foreach(sdk ${SWIFT_SDKS})

0 commit comments

Comments
 (0)