Skip to content

Commit 65505d1

Browse files
committed
[ASTGen/CMake] Link swiftOnoneSupport in "Debug" build
When building the swift compler with "Debug" configuration, modules written in Swift must be linked to swiftOnoneSupport. Explicitly link it as some linker doesn't auto-link it. rdar://162631685
1 parent 105ac4b commit 65505d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/modules/AddPureSwift.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ function(add_pure_swift_host_library name)
292292
force_target_link_libraries(${name} PUBLIC
293293
${APSHL_SWIFT_DEPENDENCIES}
294294
)
295+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
296+
target_link_libraries(${name} PUBLIC swiftSwiftOnoneSupport)
297+
endif()
295298

296299
if(APSHL_EMIT_MODULE)
297300
set(module_triple "${SWIFT_HOST_MODULE_TRIPLE}")
@@ -457,6 +460,9 @@ function(add_pure_swift_host_tool name)
457460
force_target_link_libraries(${name} PUBLIC
458461
${APSHT_SWIFT_DEPENDENCIES}
459462
)
463+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
464+
target_link_libraries(${name} PUBLIC swiftSwiftOnoneSupport)
465+
endif()
460466

461467
# Make sure we can use the host libraries.
462468
target_include_directories(${name} PUBLIC

0 commit comments

Comments
 (0)