Skip to content

Commit 0a601de

Browse files
committed
build: use the right extension for Windows for swiftrt
The swift image registrar uses the extension `.obj` as is traditional on Windows. Ensure that we get the extension correct when cross-compiling with the Swift specific cross-compilation system.
1 parent 6413d80 commit 0a601de

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,15 @@ function(_add_swift_library_single target name)
938938
# target_sources(${target}
939939
# PRIVATE
940940
# $<TARGET_OBJECTS:swiftImageRegistrationObject${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}-${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}-${SWIFTLIB_SINGLE_ARCHITECTURE}>)
941+
if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
942+
set(extension .obj)
943+
else()
944+
set(extension .o)
945+
endif()
941946
target_sources(${target}
942947
PRIVATE
943-
"${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")
944-
set_source_files_properties("${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}"
948+
"${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${extension}")
949+
set_source_files_properties("${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${extension}"
945950
PROPERTIES
946951
GENERATED 1)
947952
endif()

0 commit comments

Comments
 (0)