Skip to content

Commit b7c518e

Browse files
committed
Runtimes: establish dependency on the registrar
This removes the workaround for the exporting of the registrar and enables proper dependency tracking across projects (primarily geared towards the Overlay).
1 parent 0819b43 commit b7c518e

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

Runtimes/Core/core/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ if(SwiftCore_ENABLE_VECTOR_TYPES)
269269
"${CMAKE_CURRENT_BINARY_DIR}/SIMDVectorTypes.swift")
270270
endif()
271271

272-
set_target_properties(swiftCore PROPERTIES Swift_MODULE_NAME Swift)
272+
set_target_properties(swiftCore PROPERTIES
273+
LINKER_LANGUAGE CXX
274+
Swift_MODULE_NAME Swift)
273275

274276
target_compile_definitions(swiftCore
275277
PRIVATE
@@ -314,10 +316,15 @@ target_link_libraries(swiftCore
314316
string(TOLOWER "${SwiftCore_OBJECT_FORMAT}" SwiftCore_OBJECT_FORMAT_lc)
315317
if("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "elf")
316318
target_link_libraries(swiftCore INTERFACE
317-
swiftrt$<$<BOOL:NO>:>)
319+
swiftrt)
318320
elseif("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "coff")
319-
target_link_libraries(swiftCore INTERFACE
320-
swiftrt$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:T>)
321+
if(BUILD_SHARED_LIBS)
322+
target_link_libraries(swiftCore INTERFACE
323+
swiftrt)
324+
else()
325+
target_link_libraries(swiftCore INTERFACE
326+
swiftrtT)
327+
endif()
321328
endif()
322329

323330
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)