Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions stdlib/public/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ add_swift_library(swiftImageRegistrationObjectELF
LINK_FLAGS ${SWIFT_RUNTIME_CORE_LINK_FLAGS}
TARGET_SDKS ${ELFISH_SDKS}
INSTALL_IN_COMPONENT none)
# FIXME(compnerd) this should be compiled twice, once for static and once for
# shared. The static version should be used for building the standard library.
add_swift_library(swiftImageRegistrationObjectCOFF
OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE
SwiftRT-COFF.cpp
Expand All @@ -212,20 +214,34 @@ foreach(sdk ${SWIFT_CONFIGURED_SDKS})
# to a version which supports it.
# set(swiftrtObject "$<TARGET_OBJECTS:swiftImageRegistrationObject${SWIFT_SDK_${sdk}_OBJECT_FORMAT}-${arch_suffix}>")
set(swiftrtObject ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/swiftImageRegistrationObject${SWIFT_SDK_${sdk}_OBJECT_FORMAT}-${arch_suffix}.dir/SwiftRT-${SWIFT_SDK_${sdk}_OBJECT_FORMAT}.cpp${CMAKE_C_OUTPUT_EXTENSION})
set(swiftrtPath "${SWIFTLIB_DIR}/${arch_subdir}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")
set(shared_runtime_registrar "${SWIFTLIB_DIR}/${arch_subdir}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")
set(static_runtime_registrar "${SWIFTSTATICLIB_DIR}/${arch_subdir}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")

add_custom_command_target(swiftImageRegistration-${arch_suffix}
COMMAND
"${CMAKE_COMMAND}" -E copy "${swiftrtObject}" "${swiftrtPath}"
"${CMAKE_COMMAND}" -E copy "${swiftrtObject}" "${shared_runtime_registrar}"
COMMAND
"${CMAKE_COMMAND}" -E copy "${swiftrtObject}" "${static_runtime_registrar}"
OUTPUT
"${swiftrtPath}"
"${shared_runtime_registrar}"
"${static_runtime_registrar}"
DEPENDS
"${swiftrtObject}")
swift_install_in_component(stdlib
FILES
"${swiftrtPath}"
DESTINATION
"lib/swift/${arch_subdir}")
if(SWIFT_BUILD_DYNAMIC_STDLIB)
swift_install_in_component(stdlib
FILES
"${shared_runtime_registrar}"
DESTINATION
"lib/swift/${arch_subdir}")
endif()
if(SWIFT_BUILD_STATIC_STDLIB)
swift_install_in_component(stdlib
FILES
"${static_runtime_registrar}"
DESTINATION
"lib/swift_static/${arch_subdir}")
endif()

add_dependencies(swift-stdlib-${arch_suffix} ${swiftImageRegistration-${arch_suffix}})

add_custom_target(swiftImageRegistration-${arch_suffix}
Expand Down