Merge topic 'fix-duplicate-custom-commands'

dccd494 Use first custom command for the same output (#14446)
This commit is contained in:
Brad King 2013-10-01 08:05:17 -04:00 committed by CMake Topic Stage
commit e02e56c4a6
1 changed files with 13 additions and 0 deletions

View File

@ -1069,6 +1069,19 @@ void
cmMakefile::UpdateOutputToSourceMap(std::string const& output,
cmSourceFile* source)
{
OutputToSourceMap::iterator i = this->OutputToSource.find(output);
if(i != this->OutputToSource.end())
{
// Multiple custom commands produce the same output but may
// be attached to a different source file (MAIN_DEPENDENCY).
// LinearGetSourceFileWithOutput would return the first one,
// so keep the mapping for the first one.
//
// TODO: Warn the user about this case. However, the VS 8 generator
// triggers it for separate generate.stamp rules in ZERO_CHECK and
// individual targets.
return;
}
this->OutputToSource[output] = source;
}