Skip to content

Commit f5db1d2

Browse files
authored
Merge pull request #19824 from compnerd/lipo
2 parents 6186868 + 70a32af commit f5db1d2

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,9 @@ include(SwiftList)
448448
swift_configure_components()
449449

450450
# lipo is used to create universal binaries.
451-
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
452-
include(SwiftDarwin)
453-
if(SWIFT_LIPO)
454-
set(LIPO ${SWIFT_LIPO})
455-
else()
456-
find_toolchain_tool(LIPO "${SWIFT_DARWIN_XCRUN_TOOLCHAIN}" lipo)
457-
endif()
451+
include(SwiftToolchainUtils)
452+
if(NOT SWIFT_LIPO)
453+
find_toolchain_tool(SWIFT_LIPO "${SWIFT_DARWIN_XCRUN_TOOLCHAIN}" lipo)
458454
endif()
459455

460456
if("${SWIFT_NATIVE_LLVM_TOOLS_PATH}" STREQUAL "")

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ function(_add_swift_lipo_target)
548548
endif()
549549
# Use lipo to create the final binary.
550550
add_custom_command_target(unused_var
551-
COMMAND "${LIPO}" "-create" "-output" "${LIPO_OUTPUT}" ${source_binaries}
551+
COMMAND "${SWIFT_LIPO}" "-create" "-output" "${LIPO_OUTPUT}" ${source_binaries}
552552
${codesign_command}
553553
CUSTOM_TARGET_NAME "${LIPO_TARGET}"
554554
OUTPUT "${LIPO_OUTPUT}"

cmake/modules/StandaloneOverlay.cmake

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ list(APPEND CMAKE_MODULE_PATH
3232
${LLVM_CMAKE_MODULES_PATH}
3333
)
3434

35-
message(STATUS "FINDING LIPO")
36-
execute_process(
37-
COMMAND "xcrun" "-find" "lipo"
38-
OUTPUT_VARIABLE LIPO
39-
OUTPUT_STRIP_TRAILING_WHITESPACE)
35+
set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
36+
"The name of the toolchain to pass to 'xcrun'")
37+
38+
include(SwiftToolchainUtils)
39+
if(NOT SWIFT_LIPO)
40+
find_toolchain_tool(SWIFT_LIPO "${SWIFT_DARWIN_XCRUN_TOOLCHAIN}" lipo)
41+
endif()
4042

4143
include(AddLLVM)
4244
include(SwiftUtils)

0 commit comments

Comments
 (0)