mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 08:08:24 -05:00
VS 6,7: Refactor local generators to avoid GetSourceFileWithOutput
Use the cmSourceFile returned by AddCustomCommandToOutput instead of throwing out the return value and looking it up with GetSourceFileWithOutput.
This commit is contained in:
@@ -573,22 +573,20 @@ cmLocalVisualStudio6Generator
|
||||
|
||||
// Add the rule with the given dependencies and commands.
|
||||
const char* no_main_dependency = 0;
|
||||
this->Makefile->AddCustomCommandToOutput(output,
|
||||
depends,
|
||||
no_main_dependency,
|
||||
origCommand.GetCommandLines(),
|
||||
comment.c_str(),
|
||||
origCommand.GetWorkingDirectory());
|
||||
if(cmSourceFile* outsf =
|
||||
this->Makefile->AddCustomCommandToOutput(
|
||||
output, depends, no_main_dependency,
|
||||
origCommand.GetCommandLines(), comment.c_str(),
|
||||
origCommand.GetWorkingDirectory()))
|
||||
{
|
||||
target.AddSourceFile(outsf);
|
||||
}
|
||||
|
||||
// Replace the dependencies with the output of this rule so that the
|
||||
// next rule added will run after this one.
|
||||
depends.clear();
|
||||
depends.push_back(output);
|
||||
|
||||
// Add a source file representing this output to the project.
|
||||
cmSourceFile* outsf = this->Makefile->GetSourceFileWithOutput(output);
|
||||
target.AddSourceFile(outsf);
|
||||
|
||||
// Free the fake output name.
|
||||
delete [] output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user