summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-01-21 14:57:25 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-01-21 14:57:25 (GMT)
commitab3b549ee0dcd79607f8347a9b69c9b029590fbd (patch)
treecb4538dce956b74934597add4c69b46fe2d19bcf /Source
parent02f7e997e939dbd0c753514edcd580083cebd37c (diff)
downloadCMake-ab3b549ee0dcd79607f8347a9b69c9b029590fbd.zip
CMake-ab3b549ee0dcd79607f8347a9b69c9b029590fbd.tar.gz
CMake-ab3b549ee0dcd79607f8347a9b69c9b029590fbd.tar.bz2
CROSSCOMPILING_EMULATOR: Fix test generation for empty value
If CROSSCOMPILING_EMULATOR was set to an empty string, and a test was generated with the executable as the command, CMake would segfault upon trying to generate the test file. Fix this. Fixes: #18819
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTestGenerator.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 1e2ddc7..6032701 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -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]);