Skip to content

Commit b9e1f98

Browse files
committed
Non-Darwin SDKs product results in per-arch directories.
Depends on swiftlang/swift#19432 Unix (other than Darwin) and Windows do not support fat binaries. However, the build system was placing the build results in the platform/OS folder, instead of the per-architecture folder. Having two architectures side by side was impossible. After applying the above patch in the Swift compiler, non-Darwin platforms will look into the per-architecture folders, so the sibling projects need to leave the products in the right place.
1 parent 6162a1d commit b9e1f98

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,14 @@ if(ENABLE_SWIFT)
7272
IMPORTED_LOCATION
7373
${SWIFT_RUNTIME_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}swiftSwiftOnoneSupport${CMAKE_SHARED_LIBRARY_SUFFIX})
7474

75-
set(INSTALL_TARGET_DIR "${INSTALL_LIBDIR}/swift/${SWIFT_OS}" CACHE PATH "Path where the libraries will be installed")
75+
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
76+
set(INSTALL_TARGET_DIR_default "${INSTALL_LIBDIR}/swift/${SWIFT_OS}")
77+
else()
78+
set(INSTALL_TARGET_DIR_default "${INSTALL_LIBDIR}/swift/${SWIFT_OS}/${SWIFT_HOST_ARCH}")
79+
endif()
80+
81+
set(INSTALL_TARGET_DIR "${INSTALL_TARGET_DIR_default}" CACHE PATH "Path where the libraries will be installed")
82+
set(INSTALL_RSRC_DIR "${INSTALL_LIBDIR}/swift/${SWIFT_OS}/${SWIFT_HOST_ARCH}" CACHE PATH "Path where the compiler resources will be installed")
7683
set(INSTALL_DISPATCH_HEADERS_DIR "${INSTALL_LIBDIR}/swift/dispatch" CACHE PATH "Path where the headers will be installed for libdispatch")
7784
set(INSTALL_BLOCK_HEADERS_DIR "${INSTALL_LIBDIR}/swift/Block" CACHE PATH "Path where the headers will be installed for the blocks runtime")
7885
set(INSTALL_OS_HEADERS_DIR "${INSTALL_LIBDIR}/swift/os" CACHE PATH "Path where the os/ headers will be installed")

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,5 @@ if(ENABLE_SWIFT)
236236
${CMAKE_CURRENT_BINARY_DIR}/swift/Dispatch.swiftmodule
237237
${CMAKE_CURRENT_BINARY_DIR}/swift/Dispatch.swiftdoc
238238
DESTINATION
239-
"${INSTALL_TARGET_DIR}/${SWIFT_HOST_ARCH}")
239+
"${INSTALL_RSRC_DIR}")
240240
endif()
241-

0 commit comments

Comments
 (0)