BundleUtilities: Teach fixup_bundle to check install_name_tool result

Fail explicitly if install_name_tool fails to make an update we need.
This commit is contained in:
Ruslan Baratov 2015-02-09 20:09:41 +03:00 committed by Brad King
parent 2fd44b082b
commit a27c13f4ca
1 changed files with 6 additions and 1 deletions

View File

@ -776,7 +776,12 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
# to install_name_tool:
#
if(changes)
execute_process(COMMAND install_name_tool ${changes} "${resolved_embedded_item}")
set(cmd install_name_tool ${changes} "${resolved_embedded_item}")
execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
if(NOT install_name_tool_result EQUAL 0)
string(REPLACE ";" "' '" msg "'${cmd}'")
message(FATAL_ERROR "Command failed:\n ${msg}")
endif()
endif()
endfunction()