summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-01 12:05:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-01 12:05:17 (GMT)
commite02e56c4a6bbf4d98662d8faee27342b41f78e14 (patch)
tree3fcc1e2db63dc044a5d8c668e7dad9befeb7618f /Source/cmMakefile.cxx
parentfa97f43c81eac8379317a22d6d668984d2349fb0 (diff)
parentdccd4949c05dbabbbdbeb67be2e8d618157099d5 (diff)
downloadCMake-e02e56c4a6bbf4d98662d8faee27342b41f78e14.zip
CMake-e02e56c4a6bbf4d98662d8faee27342b41f78e14.tar.gz
CMake-e02e56c4a6bbf4d98662d8faee27342b41f78e14.tar.bz2
Merge topic 'fix-duplicate-custom-commands'
dccd494 Use first custom command for the same output (#14446)
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index fd06a33..34541e9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -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;
}