@@ -936,10 +936,15 @@ function(_add_swift_library_single target name)
936
936
# target_sources(${target}
937
937
# PRIVATE
938
938
# $<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 ()
939
944
target_sources (${target}
940
945
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 } "
943
948
PROPERTIES
944
949
GENERATED 1 )
945
950
endif ()
@@ -2139,11 +2144,20 @@ function(_add_swift_executable_single name)
2139
2144
# Find the names of dependency library targets.
2140
2145
#
2141
2146
# We don't add the ${ARCH} to the target suffix because we want to link
2142
- # against fat libraries.
2143
- _list_add_string_suffix (
2144
- "${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES} "
2145
- "-${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _LIB_SUBDIR}"
2146
- SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES_TARGETS )
2147
+ # against fat libraries. This only works for the Darwin targets as MachO is
2148
+ # the only format with the fat libraries.
2149
+ if (${SWIFTEXE_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS )
2150
+ _list_add_string_suffix (
2151
+ "${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES} "
2152
+ "-${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _LIB_SUBDIR}"
2153
+ SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES_TARGETS )
2154
+ else ()
2155
+ _list_add_string_suffix (
2156
+ "${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES} "
2157
+ "-${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _LIB_SUBDIR}-${SWIFTEXE_SINGLE_ARCHITECTURE} "
2158
+ SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES_TARGETS )
2159
+ set (SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES ${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES_TARGETS} )
2160
+ endif ()
2147
2161
2148
2162
handle_swift_sources (
2149
2163
dependency_target
0 commit comments