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/targetfile.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/targetfile.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/targetfile.cpp b/src/targetfile.cpp index 4cf5361..73cd3ff 100644 --- a/src/targetfile.cpp +++ b/src/targetfile.cpp | |||
@@ -6,6 +6,8 @@ | |||
6 | #include "function.h" | 6 | #include "function.h" |
7 | #include "viewer.h" | 7 | #include "viewer.h" |
8 | 8 | ||
9 | #include <set> | ||
10 | |||
9 | PluginInterface2(file, TargetFile, Target, "Mike Buland", 0, 1 ); | 11 | PluginInterface2(file, TargetFile, Target, "Mike Buland", 0, 1 ); |
10 | 12 | ||
11 | TargetFile::TargetFile() | 13 | TargetFile::TargetFile() |
@@ -23,6 +25,24 @@ void TargetFile::check( Build &bld ) | |||
23 | pRule->setTarget( getName() ); | 25 | pRule->setTarget( getName() ); |
24 | StringList lFinal = pRule->execute( bld, getInput(), lPerf ); | 26 | StringList lFinal = pRule->execute( bld, getInput(), lPerf ); |
25 | 27 | ||
28 | { | ||
29 | std::set<std::string> sUsed; | ||
30 | for( PerformList::iterator i = lPerf.begin(); i != lPerf.end(); i++ ) | ||
31 | { | ||
32 | isuck: if( i == lPerf.end() ) break; | ||
33 | if( sUsed.find( (*i)->getTarget() ) != sUsed.end() ) | ||
34 | { | ||
35 | PerformList::iterator j = i; | ||
36 | j++; | ||
37 | delete *i; | ||
38 | lPerf.erase( i ); | ||
39 | i = j; | ||
40 | goto isuck; | ||
41 | } | ||
42 | sUsed.insert( (*i)->getTarget() ); | ||
43 | } | ||
44 | } | ||
45 | |||
26 | bld.getView()->beginPerforms( lPerf.size() ); | 46 | bld.getView()->beginPerforms( lPerf.size() ); |
27 | 47 | ||
28 | for( PerformList::iterator i = lPerf.begin(); i != lPerf.end(); i++ ) | 48 | for( PerformList::iterator i = lPerf.begin(); i != lPerf.end(); i++ ) |