Skip to content

Commit 4b52f99

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 cb41353 commit 4b52f99

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
@@ -936,10 +936,15 @@ function(_add_swift_library_single target name)
936936
# target_sources(${target}
937937
# PRIVATE
938938
# $<TARGET_OBJECTS:swiftImageRegistrationObject${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}-${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}-${SWIFTLIB_SINGLE_ARCHITECTURE}>)
939+
if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
940+
set(extension .obj)
941+
else()
942+
set(extension .o)
943+
endif()
939944
target_sources(${target}
940945
PRIVATE
941-
"${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")
942-
set_source_files_properties("${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}"
946+
"${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${extension}")
947+
set_source_files_properties("${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swiftrt${extension}"
943948
PROPERTIES
944949
GENERATED 1)
945950
endif()

0 commit comments

Comments
 (0)