Skip to content

Commit a17cf9b

Browse files
authored
Merge pull request #80250 from compnerd/dependencies
Runtimes: establish dependency on the registrar
2 parents a75b63a + c1dbc12 commit a17cf9b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Runtimes/Core/core/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,15 @@ target_link_libraries(swiftCore
319319
string(TOLOWER "${SwiftCore_OBJECT_FORMAT}" SwiftCore_OBJECT_FORMAT_lc)
320320
if("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "elf")
321321
target_link_libraries(swiftCore INTERFACE
322-
swiftrt$<$<BOOL:NO>:>)
322+
swiftrt)
323323
elseif("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "coff")
324-
target_link_libraries(swiftCore INTERFACE
325-
swiftrt$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:T>)
324+
if(BUILD_SHARED_LIBS)
325+
target_link_libraries(swiftCore INTERFACE
326+
swiftrt)
327+
else()
328+
target_link_libraries(swiftCore INTERFACE
329+
swiftrtT)
330+
endif()
326331
endif()
327332

328333
target_link_options(swiftCore PUBLIC

Runtimes/Core/runtime/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ if("${SwiftCore_OBJECT_FORMAT}" STREQUAL "elfx")
167167
COMPONENT SwiftCore_runtime
168168
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
169169
RENAME swiftrt.o)
170+
171+
install(TARGETS swiftrt
172+
EXPORT SwiftCoreTargets
173+
COMPONENT SwiftCore_runtime)
170174
elseif("${SwiftCore_OBJECT_FORMAT}" STREQUAL "coffx")
171175
add_library(swiftrtT OBJECT SwiftRT-COFF.cpp)
172176
target_compile_definitions(swiftrtT PRIVATE
@@ -183,6 +187,10 @@ elseif("${SwiftCore_OBJECT_FORMAT}" STREQUAL "coffx")
183187
COMPONENT SwiftCore_runtime
184188
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
185189
RENAME swiftrt.obj)
190+
191+
install(TARGETS swiftrtT swiftrt
192+
EXPORT SwiftCoreTargets
193+
COMPONENT SwiftCore_runtime)
186194
elseif(NOT "${SwiftCore_OBJECT_FORMAT}" STREQUAL "x")
187195
message(SEND_ERROR "Unknown object format '${SwiftCore_OBJECT_FORMAT}'")
188196
endif()

0 commit comments

Comments
 (0)