From aff1e77f480f72b1a517ae9b7d54e56b30fab4b3 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Sat, 25 Jun 2016 13:37:44 +0200 Subject: CMakeIOSInstallCombined: do not merge content of OUTPUT and ERROR variables --- Modules/CMakeIOSInstallCombined.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake index 1256f56..d700011 100644 --- a/Modules/CMakeIOSInstallCombined.cmake +++ b/Modules/CMakeIOSInstallCombined.cmake @@ -237,17 +237,20 @@ function(ios_install_combined target destination) endif() set(cmd xcrun -f lipo) + + # Do not merge OUTPUT_VARIABLE and ERROR_VARIABLE since latter may contain + # some diagnostic information even for the successful run. execute_process( COMMAND ${cmd} RESULT_VARIABLE result OUTPUT_VARIABLE output - ERROR_VARIABLE output + ERROR_VARIABLE error_output OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE ) if(NOT result EQUAL 0) message( - FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}" + FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}\nOutput(error):\n${error_output}" ) endif() set(_lipo_path ${output}) -- cgit v0.12 From 11c3a8dc11eae4305409afbb8d7fa66ee31d41de Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Sat, 25 Jun 2016 13:48:31 +0200 Subject: CMakeIOSInstallCombined: add some sanity checks --- Modules/CMakeIOSInstallCombined.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake index d700011..234322c 100644 --- a/Modules/CMakeIOSInstallCombined.cmake +++ b/Modules/CMakeIOSInstallCombined.cmake @@ -254,6 +254,13 @@ function(ios_install_combined target destination) ) endif() set(_lipo_path ${output}) + list(LENGTH _lipo_path len) + if(NOT len EQUAL 1) + message(FATAL_ERROR "Unexpected xcrun output: ${_lipo_path}") + endif() + if(NOT EXISTS "${_lipo_path}") + message(FATAL_ERROR "File not found: ${_lipo_path}") + endif() set(CURRENT_CONFIG "${CMAKE_INSTALL_CONFIG_NAME}") set(CURRENT_TARGET "${target}") -- cgit v0.12