From 9c4ce4464b2a0dae55b7cfb2ec5fc4bd7ffc40ae Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Sep 2015 17:11:50 +0200 Subject: Override duplicate generated C++ dependency prefix --- build/cxx/compile.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'build') diff --git a/build/cxx/compile.cxx b/build/cxx/compile.cxx index f9351f2..9a3e3d7 100644 --- a/build/cxx/compile.cxx +++ b/build/cxx/compile.cxx @@ -263,9 +263,18 @@ namespace build if (j != m.end ()) { if (j->second != d) - fail << "duplicate generated dependency prefix '" << p << "'" << - info << "old mapping to " << j->second << - info << "new mapping to " << d; + { + // We used to reject duplicates but it seems this can + // be reasonably expected to work according to the order + // of the -I options. + // + if (verb >= 3) + trace << "overriding dependency prefix '" << p << "'\n" + << " old mapping to " << j->second << "\n" + << " new mapping to " << d; + + j->second = d; + } } else { -- cgit v1.1