file: GetRuntimeDependencies use CMAKE_OBJDUMP when applicable

On machines where the gnu bin utils are prefixed, or suffixed
the file(GET_RUNTIME_DEPENDENCIES ) command would fail without
explicitly setting the location of objdump.

Now we pre-populate the variables used to find objdump based
on the gnu bin utils, so that these use cases are better supported
This commit is contained in:
Robert Maynard
2020-03-27 09:03:44 -04:00
parent 888b8a43d8
commit f867423aa2
9 changed files with 102 additions and 2 deletions
@@ -188,6 +188,7 @@ else()
endif()
set(run_install_test_components 1)
run_install_test(file-GET_RUNTIME_DEPENDENCIES-variable-propagation)
run_install_test(FILES-EXCLUDE_FROM_ALL)
run_install_test(TARGETS-EXCLUDE_FROM_ALL)
run_install_test(TARGETS-NAMELINK_COMPONENT)
@@ -0,0 +1,6 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(message\):
.*
.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.*
.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.*
.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.*
.*CMAKE_OBJDUMP: custom-objdump.*
@@ -0,0 +1,6 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(message\):
.*
.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.*
.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.*
.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.*
.*CMAKE_OBJDUMP: custom-objdump.*
@@ -0,0 +1,17 @@
enable_language(C)
set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "custom-platform")
set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL "custom-platform-objdump")
set(CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND "path/to/custom-objdump")
set(CMAKE_OBJDUMP "custom-objdump")
install(CODE [[
message(FATAL_ERROR "
CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: ${CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM}
CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: ${CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL}
CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: ${CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND}
CMAKE_OBJDUMP: ${CMAKE_OBJDUMP}
")
]]
COMPONENT dev
)