From 49d885e318ee0336c202b8ad57b730f86b4230a1 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 29 Jan 2018 12:32:32 -0800 Subject: [PATCH] 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. --- cmake/modules/AddSwift.cmake | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake index 5d87b0fe3d765..8f644ed21fc60 100644 --- a/cmake/modules/AddSwift.cmake +++ b/cmake/modules/AddSwift.cmake @@ -489,12 +489,8 @@ function(_add_swift_lipo_target) OUTPUT "${LIPO_OUTPUT}" DEPENDS ${source_targets}) else() - # We don't know how to create fat binaries for other platforms. - add_custom_command_target(unused_var - COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${source_binaries}" "${LIPO_OUTPUT}" - CUSTOM_TARGET_NAME "${LIPO_TARGET}" - OUTPUT "${LIPO_OUTPUT}" - DEPENDS ${source_targets}) + add_custom_target(${LIPO_TARGET}) + add_dependencies(${LIPO_TARGET} ${source_targets}) endif() endfunction()