summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake')
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake17
1 files changed, 16 insertions, 1 deletions
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake
index 67fa30f..c4db11b 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake
@@ -4,7 +4,15 @@ set(CMAKE_CROSSCOMPILING 1)
add_executable(generated_exe_emulator_expected simple_src_exiterror.cxx)
# Executable: Return error code equal to 0
-add_executable(generated_exe_emulator_unexpected simple_src_exitsuccess.cxx)
+add_executable(generated_exe_emulator_unexpected generated_exe_emulator_unexpected.cxx)
+# Place the executable in a predictable location.
+set_property(TARGET generated_exe_emulator_unexpected PROPERTY RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_CURRENT_BINARY_DIR}>)
+
+# Executable: Imported version of above. Fake the imported target to use the above.
+add_executable(generated_exe_emulator_unexpected_imported IMPORTED)
+set_property(TARGET generated_exe_emulator_unexpected_imported PROPERTY IMPORTED_LOCATION
+ "${CMAKE_CURRENT_BINARY_DIR}/generated_exe_emulator_unexpected${CMAKE_EXECUTABLE_SUFFIX}")
+add_dependencies(generated_exe_emulator_unexpected_imported generated_exe_emulator_unexpected)
# DoesNotUseEmulator
add_custom_command(OUTPUT output1
@@ -22,6 +30,12 @@ add_custom_command(OUTPUT output3
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/output3
DEPENDS generated_exe_emulator_unexpected)
+# DoesNotUseEmulator: The command will fail if emulator is prepended
+add_custom_command(OUTPUT outputImp
+ COMMAND generated_exe_emulator_unexpected_imported
+ COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/outputImp
+ )
+
# UsesEmulator: The command only succeeds if the emulator is prepended
# to the command.
add_custom_command(OUTPUT output4
@@ -34,5 +48,6 @@ add_custom_target(ensure_build ALL
${CMAKE_CURRENT_BINARY_DIR}/output1
${CMAKE_CURRENT_BINARY_DIR}/output2
${CMAKE_CURRENT_BINARY_DIR}/output3
+ ${CMAKE_CURRENT_BINARY_DIR}/outputImp
${CMAKE_CURRENT_BINARY_DIR}/output4
)