Merge topic 'ninja-dont-parse-empty-depsflag'

f212615 Ninja: don't parse empty string
This commit is contained in:
Brad King 2013-11-05 08:16:47 -05:00 committed by CMake Topic Stage
commit f506a2efbe
1 changed files with 8 additions and 5 deletions

View File

@ -398,12 +398,15 @@ cmNinjaTargetGenerator
depfile = "$DEP_FILE";
const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
std::string depfileFlags = mf->GetSafeDefinition(flagsName.c_str());
if (!depfileFlags.empty())
{
cmSystemTools::ReplaceString(depfileFlags, "<DEPFILE>", "$DEP_FILE");
cmSystemTools::ReplaceString(depfileFlags, "<OBJECT>", "$out");
cmSystemTools::ReplaceString(depfileFlags, "<CMAKE_C_COMPILER>",
mf->GetDefinition("CMAKE_C_COMPILER"));
flags += " " + depfileFlags;
}
}
vars.Flags = flags.c_str();
vars.DependencyFile = depfile.c_str();