aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-02-08 22:13:27 +0000
committerMike Buland <eichlan@xagasoft.com>2007-02-08 22:13:27 +0000
commitec442f970358dd67c2dbc20bba3f50d1a7197829 (patch)
tree4513ce549af0b5f0f75b7d0d162774c00ce2f8dd /src
parent310cfd6025c901ab676f89b382a80a70fbf967e1 (diff)
downloadbuild-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.cpp19
-rw-r--r--src/targetfile.cpp20
2 files changed, 39 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
6Rule::Rule() : 8Rule::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 {
55isuck: 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 {
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
9PluginInterface2(file, TargetFile, Target, "Mike Buland", 0, 1 ); 11PluginInterface2(file, TargetFile, Target, "Mike Buland", 0, 1 );
10 12
11TargetFile::TargetFile() 13TargetFile::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 {
32isuck: 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++ )