From c7efb9da9b070c345473c9d22a50b60c332f2132 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 14 Jul 2012 14:41:35 +0300 Subject: [PATCH] Get rid of the install flags, which weren't entirely correct anyway --- source/sourcepackage.cpp | 26 +++++++------------------- source/sourcepackage.h | 12 ------------ 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index 456acfd..02e9152 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -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") diff --git a/source/sourcepackage.h b/source/sourcepackage.h index ecd2bc1..fa1492d 100644 --- a/source/sourcepackage.h +++ b/source/sourcepackage.h @@ -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 { 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; -- 2.45.2