While overlay directories are generally preferred, sometimes it's not
worth the effort for a small feature. In those cases the -D switch needs
to be applied to any package that might use the library's headers.
Feature::Feature(const string &n):
name(n),
- default_value("no")
+ default_value("no"),
+ exported(false)
{ }
add("choice", &Loader::choice);
add("description", &Feature::description);
add("default", &Feature::default_value);
+ add("export", &Feature::exported);
}
void Feature::Loader::choice(const string &c)
std::string description;
std::string default_value;
std::list<std::string> choices;
+ bool exported;
Feature(const std::string &);
};
{
string ident = "WITH_"+toupper(i->name);
string value = config.get_option("with_"+i->name).value;
- if(!i->choices.empty())
- build_info.defines[ident] = value;
- else if(lexical_cast<bool>(value))
- build_info.defines[ident] = "1";
+
+ if(i->choices.empty())
+ {
+ if(!lexical_cast<bool>(value))
+ continue;
+ value = "1";
+ }
+
+ build_info.defines[ident] = value;
+ if(i->exported)
+ export_binfo.defines[ident] = value;
}
for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i)