summaryrefslogtreecommitdiff
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-08-06 10:17:37 -0400
committerBrad King <brad.king@kitware.com>2013-08-06 10:20:03 -0400
commiteccb39d7f44f97d395b75b985b4e18178b72df8c (patch)
treef2d029aad3b4d3bf93bbaa3ea5aee3742e9e326e /Source/cmLocalVisualStudio6Generator.cxx
parent87e0e6e497b76f4ab7292cca34bd7c006832723b (diff)
downloadcmake-eccb39d7f44f97d395b75b985b4e18178b72df8c.tar.gz
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.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 667d86f4cd..e5b4057d28 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -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;
}