]> git.tdb.fi Git - builder.git/commitdiff
Remove the buildable flag and instead check for tool being non-null
authorMikko Rasa <tdb@tdb.fi>
Tue, 1 May 2012 08:33:42 +0000 (11:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 21:08:50 +0000 (00:08 +0300)
source/binary.cpp
source/datafile.cpp
source/filetarget.cpp
source/installedfile.cpp
source/objectfile.cpp
source/pkgconfig.cpp
source/staticlibrary.cpp
source/tarball.cpp
source/target.cpp
source/target.h

index 709dbd16a52cfbd068d9c3733ca2f7671a2ebac6..b8445c14079c8e73946862aa1d34e4d4954cbd4d 100644 (file)
@@ -16,7 +16,6 @@ Binary::Binary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
        FileTarget(b, &c.get_package(), generate_target_path(c)),
        comp(c)
 {
-       buildable = true;
        for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
                add_depend(*i);
 
index 5457a2b98f883cde0174aa85cd54ffc0477f3e0b..5566bf4a50b33a68b9f30c4f08abf1f3cb9b49a9 100644 (file)
@@ -8,7 +8,6 @@ DataFile::DataFile(Builder &b, const Component &c, File &s):
        component(c),
        source(s)
 {
-       buildable = true;
        add_depend(&source);
 
        install_location = "share/"+package->get_name();
index ad3786c76611d3012adcd154ef6bcfbac3210485..054be8143dec5c090098c0bff0405aba42168bf4 100644 (file)
@@ -30,7 +30,7 @@ void FileTarget::touch()
 
 void FileTarget::check_rebuild()
 {
-       if(!buildable)
+       if(!tool)
                return;
 
        if(builder.get_build_all())
index d0aa832b9fe8e7bf2dbaa5b442fc3582861ef19f..24ba6e1ddc4e5af3e63ce1ab1bd0f211e46c4f01 100644 (file)
@@ -16,7 +16,6 @@ InstalledFile::InstalledFile(Builder &b, const SourcePackage &p, FileTarget &s,
        FileTarget(b, &p, generate_target_path(b.get_prefix(), s, loc)),
        source(s)
 {
-       buildable = true;
        add_depend(&source);
 
        if(const SharedLibrary *shlib = dynamic_cast<const SharedLibrary *>(&source))
index e020c1b02981b391cb0172a03e7b98d49a189313..f24d028d62e56ce25078f8d35e85eb75c9335ca9 100644 (file)
@@ -14,7 +14,6 @@ ObjectFile::ObjectFile(Builder &b, const Component &c, SourceFile &s):
        comp(c),
        source(s)       
 {
-       buildable = true;
        add_depend(&source);
 }
 
index cfac2cded1e1712e304d94bdf6944a69cbeed560..9c5b7209beccdc65dc8898004ccbe27b1970775b 100644 (file)
@@ -5,7 +5,6 @@
 PkgConfig::PkgConfig(Builder &b, const SourcePackage &p):
        FileTarget(b, &p, p.get_source()/(p.get_name()+".pc"))
 {
-       buildable = true;
        tool = &builder.get_toolchain().get_tool("PCG");
 
        install_location = "lib/pkgconfig";
index c7fd78157b5ead882954dd1274464949fa9fdedf..13c4e6798bbc519f100f7bde175f1dceecabdf8c 100644 (file)
@@ -10,7 +10,6 @@ StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFi
        Library(b, package, path, c.get_name()),
        comp(c)
 {
-       buildable = true;
        for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
                add_depend(*i);
 
index 71e16377ee613cc24be87fce3d9364cf8b18b2a3..825c0ba79e237ea44c5010c262ac71d4f5ae78ba 100644 (file)
@@ -6,9 +6,7 @@ using namespace std;
 
 TarBall::TarBall(Builder &b, const SourcePackage &p, const string &n):
        FileTarget(b, &p, p.get_source()/(n+".tar"))
-{
-       buildable = true;
-}
+{ }
 
 const SourcePackage *TarBall::get_package() const
 {
index 6653c11fb0b90e0e3e916a63b7a74548c259daab..adde0cd180727b8ceb0a18d46455c60e3cf1f244 100644 (file)
@@ -15,7 +15,6 @@ Target::Target(Builder &b, const Package *p, const string &n):
        package(p),
        name(n),
        tool(0),
-       buildable(false),
        building(false),
        rebuild(false),
        deps_ready(false),
@@ -79,13 +78,11 @@ void Target::prepare()
 
 Task *Target::build()
 {
-       if(!buildable)
+       if(!tool)
        {
                rebuild = false;
                return 0;
        }
-       if(!tool)
-               throw logic_error("buildable && !tool");
 
        // XXX Minor breach of OO here
        if(FileTarget *ft = dynamic_cast<FileTarget *>(this))
index 891d75752396471978048d65cb7ffefc2f49cecf..2df56a4a49b9403fb5b5df87a43b6da1c0cf5d39 100644 (file)
@@ -29,7 +29,6 @@ protected:
        std::string name;
 
        const Tool *tool;
-       bool buildable;
        bool building;
        bool rebuild;
        std::string rebuild_reason;
@@ -67,7 +66,7 @@ public:
        void set_tool(const Tool &);
        const Tool *get_tool() const { return tool; }
 
-       bool is_buildable() const { return buildable; }
+       bool is_buildable() const { return tool!=0; }
        bool get_rebuild() const { return rebuild; }
        const std::string &get_rebuild_reason() const { return rebuild_reason; }
        bool is_installable() const { return !install_location.empty(); }