if(!component)
return;
- BuildInfo::LibraryMode libmode = component->get_build_info().libmode;
-
list<const Component *> queue;
list<Target *> dep_libs;
queue.push_back(component);
const BuildInfo &binfo = c->get_build_info();
for(BuildInfo::WordList::const_iterator i=binfo.libs.begin(); i!=binfo.libs.end(); ++i)
{
+ BuildInfo::LibraryMode libmode = component->get_build_info().get_libmode_for(*i);
Target *lib = builder.get_vfs().find_library(*i, binfo.libpath, libmode);
if(lib)
{
fatal_warnings(false)
{ }
+BuildInfo::LibraryMode BuildInfo::get_libmode_for(const string &lib) const
+{
+ LibModeMap::const_iterator i = libmodes.find(lib);
+ if(i!=libmodes.end())
+ return i->second;
+ return libmode;
+}
+
void BuildInfo::update_from(const BuildInfo &bi, UpdateLevel level)
{
for(DefineMap::const_iterator i=bi.defines.begin(); i!=bi.defines.end(); ++i)
if(level==LOCAL)
{
libmode = bi.libmode;
+ for(LibModeMap::const_iterator i=bi.libmodes.begin(); i!=bi.libmodes.end(); ++i)
+ libmodes[i->first] = i->second;
debug = bi.debug;
optimize = bi.optimize;
strip = bi.strip;
add("libpath", &Loader::libpath);
add("library", &Loader::library);
add("libmode", &BuildInfo::libmode);
+ add("libmode", &Loader::libmode_for_lib);
add("optimize", &BuildInfo::optimize);
add("strip", &BuildInfo::strip);
add("threads", &BuildInfo::threads);
obj.defines[d] = v;
}
+void BuildInfo::Loader::libmode_for_lib(const string &l, LibraryMode m)
+{
+ obj.libmodes[l] = m;
+}
+
void BuildInfo::Loader::libpath(const string &s)
{
obj.libpath.push_back(s);
private:
void incpath(const std::string &);
void define(const std::string &, const std::string &);
+ void libmode_for_lib(const std::string &, LibraryMode);
void libpath(const std::string &);
void library(const std::string &);
};
typedef std::map<std::string, std::string> DefineMap;
typedef std::list<Msp::FS::Path> PathList;
typedef std::list<std::string> WordList;
+ typedef std::map<std::string, LibraryMode> LibModeMap;
DefineMap defines;
PathList incpath;
PathList libpath;
WordList libs;
Tracked<LibraryMode> libmode;
+ LibModeMap libmodes;
Tracked<bool> threads;
Tracked<bool> debug;
Tracked<int> optimize;
BuildInfo();
+ /** Returns the library mode for linking a particular library. If no mode
+ has been specified for that library, the the global library mode is
+ returned. */
+ LibraryMode get_libmode_for(const std::string &) const;
+
/** Updates the BuildInfo from another one. Lists are concatenated, with
the first occurrence of each item preserved. Scalars are overwritten.