diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-04-25 04:39:39 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-04-25 04:39:39 +0000 |
commit | ff6852d416d73d07a85537b9c3674204865b6e68 (patch) | |
tree | 698f10b1b510f11fd5f3484dfb71beea23d1413c /src | |
parent | f88e5c349ff0107ac4a13ae00180f767741f88d1 (diff) | |
download | build-ff6852d416d73d07a85537b9c3674204865b6e68.tar.gz build-ff6852d416d73d07a85537b9c3674204865b6e68.tar.bz2 build-ff6852d416d73d07a85537b9c3674204865b6e68.tar.xz build-ff6852d416d73d07a85537b9c3674204865b6e68.zip |
Groups are better integrated, and now they also auto-generate commands if there
isn't already one with the same name.
Diffstat (limited to 'src')
-rw-r--r-- | src/build.cpp | 5 | ||||
-rw-r--r-- | src/build.h | 1 | ||||
-rw-r--r-- | src/buildparser.cpp | 18 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/build.cpp b/src/build.cpp index a7421de..113f61f 100644 --- a/src/build.cpp +++ b/src/build.cpp | |||
@@ -429,3 +429,8 @@ void Build::addToGroup( const std::string &sGroup, Target *pTarget ) | |||
429 | mGroup[sGroup].push_back( pTarget ); | 429 | mGroup[sGroup].push_back( pTarget ); |
430 | } | 430 | } |
431 | 431 | ||
432 | bool Build::hasAction( const std::string &str ) | ||
433 | { | ||
434 | return mAction.find( str ) != mAction.end(); | ||
435 | } | ||
436 | |||
diff --git a/src/build.h b/src/build.h index 768d211..0bbad0e 100644 --- a/src/build.h +++ b/src/build.h | |||
@@ -45,6 +45,7 @@ public: | |||
45 | void addRequires( const std::string &who, const std::string &what ); | 45 | void addRequires( const std::string &who, const std::string &what ); |
46 | void addRule( Rule *pRule ); | 46 | void addRule( Rule *pRule ); |
47 | void addAction( Action *pAction ); | 47 | void addAction( Action *pAction ); |
48 | bool hasAction( const std::string &str ); | ||
48 | void addToGroup( const std::string &sGroup, Target *pTarget ); | 49 | void addToGroup( const std::string &sGroup, Target *pTarget ); |
49 | 50 | ||
50 | void set( const std::string &cont, const std::string &var, const std::string &val ); | 51 | void set( const std::string &cont, const std::string &var, const std::string &val ); |
diff --git a/src/buildparser.cpp b/src/buildparser.cpp index 50fc0fc..a00bd73 100644 --- a/src/buildparser.cpp +++ b/src/buildparser.cpp | |||
@@ -590,6 +590,24 @@ Build *BuildParser::genBuild() | |||
590 | bld->addAction( pAct ); | 590 | bld->addAction( pAct ); |
591 | } | 591 | } |
592 | 592 | ||
593 | // Now create an auto check-action for each group where there isn't already | ||
594 | // an action. | ||
595 | for( TargetTmpList::iterator i = lTargetTmp.begin(); | ||
596 | i != lTargetTmp.end(); i++ ) | ||
597 | { | ||
598 | for( StringList::iterator j = (*i).second.lGroups.begin(); | ||
599 | j != (*i).second.lGroups.end(); j++ ) | ||
600 | { | ||
601 | if( !bld->hasAction( (*j) ) ) | ||
602 | { | ||
603 | Action *pAct = new Action; | ||
604 | pAct->setName( *j ); | ||
605 | pAct->addCommand( Action::actCheck, *j, true ); | ||
606 | bld->addAction( pAct ); | ||
607 | } | ||
608 | } | ||
609 | } | ||
610 | |||
593 | return bld; | 611 | return bld; |
594 | } | 612 | } |
595 | 613 | ||