Skip to content

Commit 9505d55

Browse files
committed
Build CompatibilitySpan as STATIC for build tools
In some cases, like when building the Swift toolchain build tools, `SWIFT_STDLIB_LIBRARY_BUILD_TYPES` is not defined. This causes a configuration failure when the `CompatibilitySpan` library is being added. This commit sets a default value of `STATIC` to work around this problem.
1 parent 5af7e0d commit 9505d55

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

stdlib/toolchain/CompatibilitySpan/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
22

33
set(library_name "swiftCompatibilitySpan")
44

5-
add_swift_target_library("${library_name}" ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
5+
if(SWIFT_STDLIB_LIBRARY_BUILD_TYPES)
6+
set(COMPATIBILITY_SPAN_BUILD_TYPES "${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}")
7+
else()
8+
# This is not set when building build tools for the toolchain build.
9+
set(COMPATIBILITY_SPAN_BUILD_TYPES "STATIC")
10+
endif()
11+
12+
add_swift_target_library("${library_name}" ${COMPATIBILITY_SPAN_BUILD_TYPES} IS_STDLIB
613
FakeStdlib.swift
714
../../public/core/Span/RawSpan.swift
815
../../public/core/Span/Span.swift
@@ -31,4 +38,4 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
3138
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}" -Xlinker -not_for_dyld_shared_cache
3239

3340
BACK_DEPLOYMENT_LIBRARY 6.2)
34-
endif()
41+
endif()

0 commit comments

Comments
 (0)