From 9a13fcbf02e16bda1b8d30332c97ea9460306e4d Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 22 Dec 2014 18:34:28 -0500 Subject: [PATCH] Ninja: Do not crash when CMAKE__COMPILE_OBJECT is empty (#15325) --- Source/cmNinjaTargetGenerator.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 816e6d827..b8cc5fbf8 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -454,7 +454,10 @@ cmNinjaTargetGenerator std::vector compileCmds; cmSystemTools::ExpandListArgument(compileCmd, compileCmds); - compileCmds.front().insert(0, cldeps); + if (!compileCmds.empty()) + { + compileCmds.front().insert(0, cldeps); + } for (std::vector::iterator i = compileCmds.begin(); i != compileCmds.end(); ++i)