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;
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")
class SourcePackage: public Package
{
public:
- enum InstallFlags
- {
- INCLUDE = 1,
- BIN = 2,
- LIB = 4,
- DATA = 8
- };
-
class Loader: public Msp::DataFile::DerivedObjectLoader<SourcePackage, Package>
{
private:
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;