Skip to content

Commit 5dc7719

Browse files
committed
Tie Swift backtracing pieces together in build
This patch ties the runtime and stdlib backtracing pieces together. The `__swift_isThunkFunction` SPI is provided in the backtracing runtime, which is gated behind `SWIFT_ENABLE_BACKTRACING`. If that flag is turned off, the `Backtracing` part of the stdlib fails to build because the symbols are missing, causing a build failure. I've also added the explicit `option(SWIFT_ENABLE_BACKTRACING` option so that incremental re-runs of CMake get the flag added with a nice comment and a boolean value. The option is defaulted to OFF, though build-script is defaulting it to ON.
1 parent 108a6a5 commit 5dc7719

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,10 @@ option(SWIFT_ENABLE_MACCATALYST
647647
"Build the Standard Library and overlays with MacCatalyst support"
648648
FALSE)
649649

650+
option(SWIFT_ENABLE_BACKTRACING
651+
"Build backtracing runtime support"
652+
FALSE)
653+
650654
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST "14.5" CACHE STRING
651655
"Minimum deployment target version for macCatalyst")
652656

stdlib/public/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ if(SWIFT_BUILD_STDLIB)
159159
add_subdirectory(Observation)
160160
endif()
161161

162-
add_subdirectory(Backtracing)
162+
if(SWIFT_ENABLE_BACKTRACING)
163+
add_subdirectory(Backtracing)
164+
endif()
163165
endif()
164166

165167
if(SWIFT_BUILD_REMOTE_MIRROR)

0 commit comments

Comments
 (0)