summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GetPrerequisites
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-24 21:51:08 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-02 17:45:05 (GMT)
commit82c990e9be75496e3d27203d4d092f971bf96179 (patch)
tree5399aa11060c847b6a2794150a8123d539695f7c /Tests/RunCMake/GetPrerequisites
parentbf9d3fddcc205aa4c7ad0ed8b858064ce9e30702 (diff)
downloadCMake-82c990e9be75496e3d27203d4d092f971bf96179.zip
CMake-82c990e9be75496e3d27203d4d092f971bf96179.tar.gz
CMake-82c990e9be75496e3d27203d4d092f971bf96179.tar.bz2
Tests: Improve RunCMake.GetPrerequisites sample executable selection
Get the runtime dependencies of an executable just built by the toolchain with which tests are running. Previously we used the `cmake` binary itself, but that might have been built for a different ABI than the tested binutils support.
Diffstat (limited to 'Tests/RunCMake/GetPrerequisites')
-rw-r--r--Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake4
-rw-r--r--Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake2
2 files changed, 4 insertions, 2 deletions
diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
index d1bc9b1..9cc05d0 100644
--- a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
+++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
@@ -10,7 +10,9 @@ endfunction()
# Should not throw any errors
# Regular executable
-get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "")
+if(SAMPLE_EXE)
+ get_prerequisites("${SAMPLE_EXE}" cmake_prereqs 1 1 "" "")
+endif()
# Shell script
check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh)
# Batch script
diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
index a635e38..5550c02 100644
--- a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
@@ -1,4 +1,4 @@
include(RunCMake)
run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/TargetMissing.cmake)
-run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake)
+run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -DSAMPLE_EXE=${SAMPLE_EXE} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake)