summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorMarek Antoniak <kfazol@gmail.com>2019-07-22 07:46:48 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-23 12:33:31 (GMT)
commitbf6f5467a0efadb10a227429d1411ac4514a298e (patch)
treed041fa144c8fcff9bc27df176ea9882e70992aa4 /Tests
parent79bcf4e1655ffa38e8f4740b19ec3a14ac567eec (diff)
downloadCMake-bf6f5467a0efadb10a227429d1411ac4514a298e.zip
CMake-bf6f5467a0efadb10a227429d1411ac4514a298e.tar.gz
CMake-bf6f5467a0efadb10a227429d1411ac4514a298e.tar.bz2
Fix allocation in CROSSCOMPILING_EMULATOR evaluation
In commit fec441ec17 (Teach CROSSCOMPILING_EMULATOR to support arguments, 2019-05-30, v3.15.0-rc1~6^2) the new member `cmCustomCommandGenerator::EmulatorsWithArguments` was not initialized to the proper size. Fix this and add a test case covering the crash that could occur with multiple commands where an emulator appears only in a later command. Fixes: #19500 Co-Author: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake
index c4db11b..9fcc5bc 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake
@@ -26,12 +26,14 @@ add_custom_command(OUTPUT output2
# DoesNotUseEmulator: The command will fail if emulator is prepended
add_custom_command(OUTPUT output3
+ COMMAND ${CMAKE_COMMAND} -E echo generated_exe_emulator_unexpected
COMMAND $<TARGET_FILE:generated_exe_emulator_unexpected>
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 ${CMAKE_COMMAND} -E echo generated_exe_emulator_unexpected_imported
COMMAND generated_exe_emulator_unexpected_imported
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/outputImp
)
@@ -39,6 +41,7 @@ add_custom_command(OUTPUT outputImp
# UsesEmulator: The command only succeeds if the emulator is prepended
# to the command.
add_custom_command(OUTPUT output4
+ COMMAND ${CMAKE_COMMAND} -E echo generated_exe_emulator_expected
COMMAND generated_exe_emulator_expected
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/output4
DEPENDS generated_exe_emulator_expected)