[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
This commit is contained in:
Rintaro Ishizaki
2025-10-15 09:58:47 -07:00
parent 105ac4b8c2
commit 65505d197b

View File

@@ -292,6 +292,9 @@ function(add_pure_swift_host_library name)
force_target_link_libraries(${name} PUBLIC force_target_link_libraries(${name} PUBLIC
${APSHL_SWIFT_DEPENDENCIES} ${APSHL_SWIFT_DEPENDENCIES}
) )
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(${name} PUBLIC swiftSwiftOnoneSupport)
endif()
if(APSHL_EMIT_MODULE) if(APSHL_EMIT_MODULE)
set(module_triple "${SWIFT_HOST_MODULE_TRIPLE}") set(module_triple "${SWIFT_HOST_MODULE_TRIPLE}")
@@ -457,6 +460,9 @@ function(add_pure_swift_host_tool name)
force_target_link_libraries(${name} PUBLIC force_target_link_libraries(${name} PUBLIC
${APSHT_SWIFT_DEPENDENCIES} ${APSHT_SWIFT_DEPENDENCIES}
) )
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(${name} PUBLIC swiftSwiftOnoneSupport)
endif()
# Make sure we can use the host libraries. # Make sure we can use the host libraries.
target_include_directories(${name} PUBLIC target_include_directories(${name} PUBLIC