diff options
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 5e8731a..758a69a 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -25,6 +25,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, , OldStyle(cc.GetEscapeOldStyle()) , MakeVars(cc.GetEscapeAllowMakeVars()) , GE(new cmGeneratorExpression(cc.GetBacktrace())) + , EmulatorsWithArguments(cc.GetCommandLines().size()) { const cmCustomCommandLines& cmdlines = this->CC.GetCommandLines(); for (cmCustomCommandLine const& cmdline : cmdlines) { @@ -107,7 +108,6 @@ void cmCustomCommandGenerator::FillEmulatorsWithArguments() continue; } - this->EmulatorsWithArguments.emplace_back(); cmSystemTools::ExpandListArgument(emulator_property, this->EmulatorsWithArguments[c]); } 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) |