Skip to content

Commit 3ec2e67

Browse files
committed
[Backtracing] Really only build for OS X.
Added some extra code to AddSwiftStdlib.cmake so executable targets can specify target SDKs the same way libraries currently can. Updated the Backtracing targets to specify just OS X for now.
1 parent aeb0323 commit 3ec2e67

File tree

10 files changed

+23
-12
lines changed

10 files changed

+23
-12
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2680,6 +2680,7 @@ function(add_swift_target_executable name)
26802680
SWIFT_MODULE_DEPENDS_FROM_SDK
26812681
SWIFT_MODULE_DEPENDS_MACCATALYST
26822682
SWIFT_MODULE_DEPENDS_MACCATALYST_UNZIPPERED
2683+
TARGET_SDKS
26832684
)
26842685

26852686
# Parse the arguments we were given.
@@ -2706,7 +2707,16 @@ function(add_swift_target_executable name)
27062707
# All Swift executables depend on the swiftSwiftOnoneSupport library.
27072708
list(APPEND SWIFTEXE_TARGET_SWIFT_MODULE_DEPENDS SwiftOnoneSupport)
27082709

2709-
foreach(sdk ${SWIFT_SDKS})
2710+
# If target SDKs are not specified, build for all known SDKs.
2711+
if("${SWIFTEXE_TARGET_TARGET_SDKS}" STREQUAL "")
2712+
set(SWIFTEXE_TARGET_TARGET_SDKS ${SWIFT_SDKS})
2713+
endif()
2714+
list_replace(SWIFTEXE_TARGET_TARGET_SDKS ALL_APPLE_PLATFORMS "${SWIFT_DARWIN_PLATFORMS}")
2715+
2716+
list_intersect(
2717+
"${SWIFTEXE_TARGET_TARGET_SDKS}" "${SWIFT_SDKS}" SWIFTEXE_TARGET_TARGET_SDKS)
2718+
2719+
foreach(sdk ${SWIFTEXE_TARGET_TARGET_SDKS})
27102720
set(THIN_INPUT_TARGETS)
27112721

27122722
# Collect architecture agnostic SDK module dependencies

stdlib/public/Backtracing/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ add_swift_target_library(swift_Backtracing ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
5555

5656
INSTALL_IN_COMPONENT stdlib
5757
MACCATALYST_BUILD_FLAVOR "zippered"
58+
59+
TARGET_SDKS OSX
5860
)

stdlib/public/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ if(SWIFT_BUILD_STDLIB)
159159
add_subdirectory(Observation)
160160
endif()
161161

162-
# Make this macOS only for now.
163-
if(OSX IN_LIST SWIFT_SDKS)
164-
add_subdirectory(Backtracing)
165-
endif()
162+
add_subdirectory(Backtracing)
166163
endif()
167164

168165
if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR)

stdlib/public/libexec/swift-backtrace/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ add_swift_target_executable(swift-backtrace BUILD_WITH_STDLIB
99
_Backtracing
1010

1111
INSTALL_IN_COMPONENT stdlib
12-
COMPILE_FLAGS -parse-as-library)
12+
COMPILE_FLAGS -parse-as-library
13+
14+
TARGET_SDKS OSX)

test/Backtracing/BacktraceWithLimit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-run %t/BacktraceWithLimit | %FileCheck %s
55

66
// REQUIRES: executable_test
7-
// REQUIRES: OS=macosx || OS=ios
7+
// REQUIRES: OS=macosx
88

99
import _Backtracing
1010

test/Backtracing/BacktraceWithLimitAndTop.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-run %t/BacktraceWithLimitAndTop | %FileCheck %s
55

66
// REQUIRES: executable_test
7-
// REQUIRES: OS=macosx || OS=ios
7+
// REQUIRES: OS=macosx
88

99
import _Backtracing
1010

test/Backtracing/SimpleAsyncBacktrace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// REQUIRES: concurrency
77
// REQUIRES: executable_test
8-
// REQUIRES: OS=macosx || OS=iOS || OS=watchOS || OS=tvOS
8+
// REQUIRES: OS=macosx
99
// REQUIRES: concurrency_runtime
1010
// UNSUPPORTED: back_deployment_runtime
1111

test/Backtracing/SimpleBacktrace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-run %t/SimpleBacktrace | %FileCheck %s
55

66
// REQUIRES: executable_test
7-
// REQUIRES: OS=macosx || OS=iOS || OS=watchOS || OS=tvOS
7+
// REQUIRES: OS=macosx
88

99
func level1() {
1010
level2()

test/Backtracing/SymbolicatedBacktrace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-run %t/SymbolicatedBacktrace | %FileCheck %s
55

66
// REQUIRES: executable_test
7-
// REQUIRES: OS=macosx || OS=ios || OS=watchOS || OS=tvOS
7+
// REQUIRES: OS=macosx
88

99
import _Backtracing
1010

test/Backtracing/SymbolicatedBacktraceInline.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-run %t/SymbolicatedBacktraceInline | %FileCheck %s
55

66
// REQUIRES: executable_test
7-
// REQUIRES: OS=macosx || OS=ios || OS=watchOS || OS=tvOS
7+
// REQUIRES: OS=macosx
88

99
import _Backtracing
1010

0 commit comments

Comments
 (0)