This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 8b2eb31aa2d35897bd4b88ec4ee26f93cf1ee83f (commit) via dccd4949c05dbabbbdbeb67be2e8d618157099d5 (commit) from 92e0db00464f447dbab81d2cf94fec16ba8dcbd8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b2eb31aa2d35897bd4b88ec4ee26f93cf1ee83f commit 8b2eb31aa2d35897bd4b88ec4ee26f93cf1ee83f Merge: 92e0db0 dccd494 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Sep 30 15:06:05 2013 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Mon Sep 30 15:06:05 2013 -0400 Merge topic 'fix-duplicate-custom-commands' into next dccd494 Use first custom command for the same output (#14446) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dccd4949c05dbabbbdbeb67be2e8d618157099d5 commit dccd4949c05dbabbbdbeb67be2e8d618157099d5 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Sep 30 09:27:49 2013 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Mon Sep 30 15:03:00 2013 -0400 Use first custom command for the same output (#14446) In buggy code like add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/out.h MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/out.h.in ...) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/out.h ...) that has more than one rule to generate the same output CMake has always used the first rule. However, since commit 2268c41a (Optimize custom command full-path dependency lookup, 2013-08-06) we update the map from output to cmSourceFile for every rule generating an output, effectively keeping the last command instead of the first. Fix this regression by checking for each map update if the output already has an entry. If so, keep only the original entry. The VS 8 generator triggers this with a special case for generate.stamp rules that differ between ZERO_CHECK and normal targets, so do not warn for now. Leave a TODO comment for warning in the future. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 08c9763..848b1f1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1033,6 +1033,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; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits