]> git.tdb.fi Git - builder.git/commitdiff
Get rid of the install flags, which weren't entirely correct anyway
authorMikko Rasa <tdb@tdb.fi>
Sat, 14 Jul 2012 11:41:35 +0000 (14:41 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 15 Jul 2012 14:05:47 +0000 (17:05 +0300)
source/sourcepackage.cpp
source/sourcepackage.h

index 456acfd6af1e0f37505a6973c3ce20e8bd0f3764..02e9152a7b3ef52abcf5042bcf41d56516b7ac0a 100644 (file)
@@ -44,21 +44,6 @@ FS::Path SourcePackage::get_out_dir() const
                return source/arch.get_name()/config.get_option("outdir").value;
 }
 
-unsigned SourcePackage::get_install_flags()
-{
-       unsigned flags = 0;
-       for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i)
-               if(i->get_install())
-               {
-                       if(i->get_type()==Component::PROGRAM)
-                               flags |= BIN;
-                       else if(i->get_type()==Component::LIBRARY || i->get_type()==Component::MODULE)
-                               flags |= LIB|INCLUDE;
-               }
-
-       return flags;
-}
-
 LibMode SourcePackage::get_library_mode() const
 {
        const string &mode = config.get_option("staticlibs").value;
@@ -180,15 +165,18 @@ void SourcePackage::create_build_info()
        const StringList &warnings = builder.get_warnings();
        build_info.warnings.insert(build_info.warnings.begin(), warnings.begin(), warnings.end());
 
-       unsigned flags = get_install_flags();
-
        build_info.incpath.push_back((builder.get_prefix()/"include").str());
        build_info.libpath.push_back((builder.get_prefix()/"lib").str());
 
-       if(flags&INCLUDE)
+       bool export_paths = false;
+       for(ComponentList::const_iterator i=components.begin(); (!export_paths && i!=components.end()); ++i)
+               export_paths = (i->get_type()==Component::LIBRARY);
+
+       if(export_paths)
+       {
                export_binfo.incpath.push_back((builder.get_prefix()/"include").str());
-       if(flags&LIB)
                export_binfo.libpath.push_back((builder.get_prefix()/"lib").str());
+       }
 
        string optimize = config.get_option("optimize").value;
        if(!optimize.empty() && optimize!="0")
index ecd2bc15e4ac1a78091be79d08311b304ce8de9f..fa1492d61605862b4eb44f54706f03b229c957ab 100644 (file)
@@ -26,14 +26,6 @@ A package that can be built by Builder.
 class SourcePackage: public Package
 {
 public:
-       enum InstallFlags
-       {
-               INCLUDE = 1,
-               BIN = 2,
-               LIB = 4,
-               DATA = 8
-       };
-
        class Loader: public Msp::DataFile::DerivedObjectLoader<SourcePackage, Package>
        {
        private:
@@ -79,10 +71,6 @@ public:
        const BuildInfo &get_exported_binfo() const { return export_binfo; }
        Builder &get_builder() const { return builder; }
 
-       /** Returns a bitmask indicating which kinds of things the components of
-       this package install. */
-       unsigned get_install_flags();
-
        LibMode get_library_mode() const;
        DependencyCache &get_deps_cache() const { return deps_cache; }
        std::string expand_string(const std::string &) const;