summaryrefslogtreecommitdiff
path: root/Source/cmDependsCompiler.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-01-16 14:04:05 +0100
committerMarc Chevrier <marc.chevrier@gmail.com>2022-01-16 16:21:12 +0100
commit0b65a2b2531b05abe1bc1f1950bb963af7a6d42f (patch)
treef030499394a3dd427ff56f1d30424307254ef705 /Source/cmDependsCompiler.cxx
parente04a352cca523eba2ac0d60063a3799f5bb1c69e (diff)
downloadcmake-0b65a2b2531b05abe1bc1f1950bb963af7a6d42f.tar.gz
add_custom_command(DEPFILE): ensure all dependencies are taken into account
Diffstat (limited to 'Source/cmDependsCompiler.cxx')
-rw-r--r--Source/cmDependsCompiler.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmDependsCompiler.cxx b/Source/cmDependsCompiler.cxx
index bf599ffaf0..0cc4946e48 100644
--- a/Source/cmDependsCompiler.cxx
+++ b/Source/cmDependsCompiler.cxx
@@ -4,6 +4,7 @@
#include "cmDependsCompiler.h"
#include <algorithm>
+#include <iterator>
#include <map>
#include <memory>
#include <string>
@@ -111,9 +112,13 @@ bool cmDependsCompiler::CheckDependencies(
// copy depends for each target, except first one, which can be
// moved
for (auto index = entry.rules.size() - 1; index > 0; --index) {
- dependencies[entry.rules[index]] = depends;
+ auto& rule_deps = dependencies[entry.rules[index]];
+ rule_deps.insert(rule_deps.end(), depends.cbegin(),
+ depends.cend());
}
- dependencies[entry.rules.front()] = std::move(depends);
+ auto& rule_deps = dependencies[entry.rules.front()];
+ std::move(depends.cbegin(), depends.cend(),
+ std::back_inserter(rule_deps));
}
} else {
if (format == "msvc"_s) {