mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 07:11:05 -06:00
Ninja: also stop when .rc's .d file couldn't be generated
prevents silent disappearing of .d files for resource files. cmcldeps changes directory for cl call, so relativ include paths do not work.
This commit is contained in:
@@ -143,16 +143,18 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source,
|
||||
this->LocalGenerator->AddCMP0018Flags(flags, this->Target,
|
||||
language.c_str());
|
||||
|
||||
// TODO: Handle response file.
|
||||
// Add include directory flags.
|
||||
{
|
||||
std::vector<std::string> includes;
|
||||
this->LocalGenerator->GetIncludeDirectories(includes, this->Target,
|
||||
language.c_str());
|
||||
std::string includeFlags =
|
||||
this->LocalGenerator->GetIncludeFlags(includes, language.c_str(), false);
|
||||
this->LocalGenerator->GetIncludeFlags(includes, language.c_str(),
|
||||
language == "RC" ? true : false); // full include paths for RC
|
||||
// needed by cmcldeps
|
||||
if(cmGlobalNinjaGenerator::IsMinGW())
|
||||
cmSystemTools::ReplaceString(includeFlags, "\\", "/");
|
||||
|
||||
this->LocalGenerator->AppendFlags(flags, includeFlags.c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ static int process( const std::string& srcfilename,
|
||||
includes.push_back(inc);
|
||||
} else {
|
||||
if (!isFirstLine || !startsWith(line, srcfilename)) {
|
||||
if (!quiet) {
|
||||
if (!quiet || exit_code != 0) {
|
||||
fprintf(stdout, "%s\n", line.c_str());
|
||||
}
|
||||
} else {
|
||||
@@ -267,8 +267,11 @@ int main() {
|
||||
}
|
||||
|
||||
// extract dependencies with cl.exe
|
||||
process(srcfilename, dfile, objfile,
|
||||
prefix, cl + nol + show + clrest, objdir, true);
|
||||
int exit_code = process(srcfilename, dfile, objfile,
|
||||
prefix, cl + nol + show + clrest, objdir, true);
|
||||
|
||||
if (exit_code != 0)
|
||||
return exit_code;
|
||||
|
||||
// compile rc file with rc.exe
|
||||
return process(srcfilename, "" , objfile, prefix, binpath + " " + rest);
|
||||
|
||||
Reference in New Issue
Block a user