BuildInfo binfo;
tgt->collect_build_info(binfo);
if(tgt!=this)
+ {
static_binfo.libpath.insert(static_binfo.libpath.end(), binfo.libpath.begin(), binfo.libpath.end());
+ static_binfo.keep_symbols.insert(static_binfo.keep_symbols.end(), binfo.keep_symbols.begin(), binfo.keep_symbols.end());
+ }
list<Target *>::iterator insert_pos = j;
++insert_pos;
libmode = bi.libmode;
for(LibModeMap::const_iterator i=bi.libmodes.begin(); i!=bi.libmodes.end(); ++i)
libmodes[i->first] = i->second;
+ keep_symbols.insert(keep_symbols.end(), bi.keep_symbols.begin(), bi.keep_symbols.end());
for(StandardMap::const_iterator i=bi.standards.begin(); i!=bi.standards.end(); ++i)
standards[i->first] = i->second;
debug = bi.debug;
add("debug", &BuildInfo::debug);
add("define", &Loader::define);
add("incpath", &Loader::incpath);
+ add("keep_symbol", &Loader::keep_symbol);
add("libpath", &Loader::libpath);
add("library", &Loader::library);
add("libmode", &BuildInfo::libmode);
obj.defines[d] = v;
}
+void BuildInfo::Loader::keep_symbol(const string &s)
+{
+ obj.keep_symbols.push_back(s);
+}
+
void BuildInfo::Loader::libmode_for_lib(const string &l, LibraryMode m)
{
obj.libmodes[l] = m;
private:
void incpath(const std::string &);
void define(const std::string &, const std::string &);
+ void keep_symbol(const std::string &);
void libmode_for_lib(const std::string &, LibraryMode);
void libpath(const std::string &);
void library(const std::string &);
WordList libs;
Tracked<LibraryMode> libmode;
LibModeMap libmodes;
+ WordList keep_symbols;
StandardMap standards;
Tracked<bool> threads;
Tracked<bool> debug;
argv.push_back("-o");
argv.push_back(relative(bin.get_path(), work_dir).str());
+ for(BuildInfo::WordList::const_iterator i=binfo.keep_symbols.begin(); i!=binfo.keep_symbols.end(); ++i)
+ argv.push_back("-u"+*i);
+
bool static_link_ok = (binfo.libmode<=BuildInfo::STATIC);
const Target::Dependencies &depends = target.get_dependencies();