]> git.tdb.fi Git - builder.git/blobdiff - source/package.cpp
Add DependencyCache to speed up build preparation
[builder.git] / source / package.cpp
index 49866a71d2442f8aff3fd902c12d52c31aa98554..8fb2b4dde4ffe8dda0e0b2507aca1174ca7ee968 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of builder
+Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include <msp/strings/lexicalcast.h>
 #include <msp/strings/utils.h>
 #include "builder.h"
@@ -19,9 +26,12 @@ Package::Package(Builder &b, const string &n, const Path::Path &s):
        source(s),
        config(*this),
        conf_done(false),
+       deps_cache(*this),
        use_pkgconfig(true),
        need_path(false)
 {
+       tar_files.push_back(source/"Build");
+
        if(builder.get_verbose()>=4)
                cout<<"Created buildable package "<<n<<" at "<<s<<'\n';
 }
@@ -158,6 +168,8 @@ void Package::configure(const StringMap &opts, unsigned flag)
                                (*i)->set_path(config.get_option((*i)->get_name()+"_path").value);
                        (*i)->configure(opts, flag&2);
                }
+
+               deps_cache.load();
        }
 
        create_build_info();
@@ -216,7 +228,8 @@ Package::Package(Builder &b, const string &n, const vector<string> &info):
        name(n),
        buildable(false),
        config(*this),
-       conf_done(false)
+       conf_done(false),
+       deps_cache(*this)
 {
        for(vector<string>::const_iterator i=info.begin(); i!=info.end(); ++i)
        {
@@ -349,6 +362,7 @@ void Package::create_build_info()
        export_binfo.unique();
 }
 
+
 Package::Loader::Loader(Package &p):
        pkg(p)
 {
@@ -362,6 +376,7 @@ Package::Loader::Loader(Package &p):
        add("module",      &Loader::module);
        add("headers",     &Loader::headers);
        add("build_info",  &Loader::build_info);
+       add("tar_file",    &Loader::tar_file);
 }
 
 void Package::Loader::require(const string &n)
@@ -413,3 +428,8 @@ void Package::Loader::build_info()
 {
        load_sub(pkg.build_info);
 }
+
+void Package::Loader::tar_file(const string &f)
+{
+       pkg.tar_files.push_back(pkg.source/f);
+}