Skip to content

Commit fb59fc8

Browse files
compnerdktopley-apple
authored andcommitted
build: link against swiftOnoneSupport in debug configuration
When building debug, swift requires a supplementary library. The swift driver is aware of this and will make the appropriate arrangements. However, since the swift component is compacted into the C library, the linker driver being used does not understand this requirement. Explicitly link against the support library. This allows building the debug configuration of libdispatch with a release configuration of the swift standard library. Signed-off-by: Kim Topley <[email protected]>
1 parent 51ca92b commit fb59fc8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if(HAVE_OBJC)
7979
endif()
8080
if(ENABLE_SWIFT)
8181
set(swift_optimization_flags)
82-
if(CMAKE_BUILD_TYPE MATCHES Release)
82+
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
8383
set(swift_optimization_flags -O)
8484
endif()
8585
add_swift_library(swiftDispatch
@@ -116,6 +116,11 @@ if(ENABLE_SWIFT)
116116
PRIVATE
117117
swift/DispatchStubs.cc
118118
${CMAKE_CURRENT_BINARY_DIR}/swiftDispatch.o)
119+
if(CMAKE_BUILD_TYPE MATCHES Debug)
120+
target_link_libraries(dispatch
121+
PRIVATE
122+
swiftSwiftOnoneSupport)
123+
endif()
119124
endif()
120125
if(ENABLE_DTRACE)
121126
dtrace_usdt_probe(${CMAKE_CURRENT_SOURCE_DIR}/provider.d

0 commit comments

Comments
 (0)