diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-02-08 22:13:27 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-02-08 22:13:27 +0000 |
commit | ec442f970358dd67c2dbc20bba3f50d1a7197829 (patch) | |
tree | 4513ce549af0b5f0f75b7d0d162774c00ce2f8dd /src/rule.cpp | |
parent | 310cfd6025c901ab676f89b382a80a70fbf967e1 (diff) | |
download | build-ec442f970358dd67c2dbc20bba3f50d1a7197829.tar.gz build-ec442f970358dd67c2dbc20bba3f50d1a7197829.tar.bz2 build-ec442f970358dd67c2dbc20bba3f50d1a7197829.tar.xz build-ec442f970358dd67c2dbc20bba3f50d1a7197829.zip |
build doesn't tollerate duplicates anymore.
Diffstat (limited to '')
-rw-r--r-- | src/rule.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rule.cpp b/src/rule.cpp index 2f87d85..7924ba4 100644 --- a/src/rule.cpp +++ b/src/rule.cpp | |||
@@ -3,6 +3,8 @@ | |||
3 | #include "function.h" | 3 | #include "function.h" |
4 | #include "perform.h" | 4 | #include "perform.h" |
5 | 5 | ||
6 | #include <set> | ||
7 | |||
6 | Rule::Rule() : | 8 | Rule::Rule() : |
7 | pAggregate( NULL ) | 9 | pAggregate( NULL ) |
8 | { | 10 | { |
@@ -46,6 +48,23 @@ StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf, bo | |||
46 | lProduces.push_back( sTarget ); | 48 | lProduces.push_back( sTarget ); |
47 | } | 49 | } |
48 | 50 | ||
51 | { | ||
52 | std::set<std::string> sUsed; | ||
53 | for( StringList::iterator i = lInput.begin(); i != lInput.end(); i++ ) | ||
54 | { | ||
55 | isuck: if( i == lInput.end() ) break; | ||
56 | if( sUsed.find( *i ) != sUsed.end() ) | ||
57 | { | ||
58 | StringList::iterator j = i; | ||
59 | j++; | ||
60 | lInput.erase( i ); | ||
61 | i = j; | ||
62 | goto isuck; | ||
63 | } | ||
64 | sUsed.insert( *i ); | ||
65 | } | ||
66 | } | ||
67 | |||
49 | StringList lNewOut; | 68 | StringList lNewOut; |
50 | if( pAggregate ) | 69 | if( pAggregate ) |
51 | { | 70 | { |