mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
Merge topic 'crosscompiling_emulator-fix'
ab3b549ee0 CROSSCOMPILING_EMULATOR: Fix test generation for empty value
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2834
This commit is contained in:
@@ -90,7 +90,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
|
||||
|
||||
// Prepend with the emulator when cross compiling if required.
|
||||
const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
|
||||
if (emulator != nullptr) {
|
||||
if (emulator != nullptr && *emulator) {
|
||||
std::vector<std::string> emulatorWithArgs;
|
||||
cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
|
||||
std::string emulatorExe(emulatorWithArgs[0]);
|
||||
|
||||
@@ -26,3 +26,9 @@ get_property(emulator TARGET target_without_emulator
|
||||
if(NOT "${emulator}" STREQUAL "")
|
||||
message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set to null")
|
||||
endif()
|
||||
|
||||
add_executable(target_with_empty_emulator simple_src_exiterror.cxx)
|
||||
set_property(TARGET target_with_empty_emulator PROPERTY CROSSCOMPILING_EMULATOR "")
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME test_target_with_empty_emulator COMMAND target_with_empty_emulator)
|
||||
|
||||
Reference in New Issue
Block a user