Skip to content

Commit 0ce4afe

Browse files
authored
Merge pull request #21084 from compnerd/5.0-build
5.0 build
2 parents 57d8b7c + 4b52f99 commit 0ce4afe

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 21 additions & 7 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()
@@ -2139,11 +2144,20 @@ function(_add_swift_executable_single name)
21392144
# Find the names of dependency library targets.
21402145
#
21412146
# 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()
21472161

21482162
handle_swift_sources(
21492163
dependency_target

stdlib/public/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ if(SWIFT_BUILD_STDLIB)
5555
add_subdirectory(runtime)
5656
add_subdirectory(stubs)
5757
add_subdirectory(core)
58-
add_subdirectory(SIMDOperators)
5958
add_subdirectory(SwiftOnoneSupport)
59+
60+
# NOTE(compnerd) this must come after the SwiftOnoneSupport as the current
61+
# cross-compilation support has to hand roll the import library setup which
62+
# requires that the target is setup prior to use.
63+
add_subdirectory(SIMDOperators)
6064
endif()
6165

6266
if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR)

0 commit comments

Comments
 (0)