Skip to content

Commit ff5d635

Browse files
committed
build: strip the lipo'ed target placeholder
When building non-MachO targets, there is no support for fat binaries. As a result, the lipo target does nothing. Because we do not support variant builds for ELF targets, this has not resulted in any issues. However, the PE/COFF (Windows) target suppots multiple variants. In such a case, the "lipo" target will copy a number of builds, leaving the binary to be an arbitrary variant. Instead, prefer to always use the architectural variant path. In place, create an empty target which serves as a means of collecting dependencies.
1 parent 784c98b commit ff5d635

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,8 @@ function(_add_swift_lipo_target)
486486
DEPENDS ${source_targets})
487487
else()
488488
# We don't know how to create fat binaries for other platforms.
489-
add_custom_command_target(unused_var
490-
COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${source_binaries}" "${LIPO_OUTPUT}"
491-
CUSTOM_TARGET_NAME "${LIPO_TARGET}"
492-
OUTPUT "${LIPO_OUTPUT}"
493-
DEPENDS ${source_targets})
489+
add_custom_target(${LIPO_TARGET})
490+
add_dependencies(${LIPO_TARGET} ${source_targets})
494491
endif()
495492
endfunction()
496493

0 commit comments

Comments
 (0)