summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-12-22 23:34:28 (GMT)
committerBrad King <brad.king@kitware.com>2014-12-22 23:36:07 (GMT)
commit9a13fcbf02e16bda1b8d30332c97ea9460306e4d (patch)
tree69f1503da0144746487a69b31f709b7940194cfc /Source/cmNinjaTargetGenerator.cxx
parentc118816d44e178e4364a0c32aaece81a14511237 (diff)
downloadCMake-9a13fcbf02e16bda1b8d30332c97ea9460306e4d.zip
CMake-9a13fcbf02e16bda1b8d30332c97ea9460306e4d.tar.gz
CMake-9a13fcbf02e16bda1b8d30332c97ea9460306e4d.tar.bz2
Ninja: Do not crash when CMAKE_<LANG>_COMPILE_OBJECT is empty (#15325)
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 816e6d8..b8cc5fb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -454,7 +454,10 @@ cmNinjaTargetGenerator
std::vector<std::string> compileCmds;
cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
- compileCmds.front().insert(0, cldeps);
+ if (!compileCmds.empty())
+ {
+ compileCmds.front().insert(0, cldeps);
+ }
for (std::vector<std::string>::iterator i = compileCmds.begin();
i != compileCmds.end(); ++i)