threads = bi.threads;
if(level==LOCAL)
{
+ local_incpath.insert(local_incpath.end(), bi.local_incpath.begin(), bi.local_incpath.end());
libmode = bi.libmode;
for(LibModeMap::const_iterator i=bi.libmodes.begin(); i!=bi.libmodes.end(); ++i)
libmodes[i->first] = i->second;
add("library", &Loader::library);
add("libmode", &BuildInfo::libmode);
add("libmode", &Loader::libmode_for_lib);
+ add("local_incpath", &Loader::local_incpath);
add("optimize", &BuildInfo::optimize);
add("strip", &BuildInfo::strip);
add("threads", &BuildInfo::threads);
obj.libs.push_back(s);
}
+void BuildInfo::Loader::local_incpath(const string &s)
+{
+ obj.local_incpath.push_back(s);
+}
+
void operator>>(const LexicalConverter &conv, BuildInfo::LibraryMode &libmode)
{
void libmode_for_lib(const std::string &, LibraryMode);
void libpath(const std::string &);
void library(const std::string &);
+ void local_incpath(const std::string &);
};
enum UpdateLevel
DefineMap defines;
PathList incpath;
+ PathList local_incpath;
PathList libpath;
WordList libs;
Tracked<LibraryMode> libmode;
cache.set_values(this, "includes", includes);
}
- const BuildInfo::PathList &incpath = component->get_build_info().incpath;
+ const BuildInfo &build_info = component->get_build_info_for_path(path);
+ const BuildInfo::PathList &incpath = build_info.incpath;
BuildInfo::PathList local_incpath = incpath;
+ local_incpath.insert(local_incpath.begin(), build_info.local_incpath.begin(), build_info.local_incpath.end());
local_incpath.push_front(FS::dirname(path).str());
for(IncludeList::iterator i=includes.begin(); i!=includes.end(); ++i)
argv.push_back(executable->get_path().str());
argv.push_back("-c");
- const BuildInfo &binfo = comp.get_build_info();
+ const BuildInfo &binfo = comp.get_build_info_for_path(object.get_source().get_path());
if(binfo.warning_level>=1)
{
argv.push_back("-Wall");
if(binfo.fatal_warnings)
argv.push_back("-Werror");
}
+ for(BuildInfo::PathList::const_iterator i=binfo.local_incpath.begin(); i!=binfo.local_incpath.end(); ++i)
+ {
+ argv.push_back("-iquote");
+ argv.push_back(i->str());
+ }
for(BuildInfo::PathList::const_iterator i=binfo.incpath.begin(); i!=binfo.incpath.end(); ++i)
argv.push_back("-I"+i->str());
for(BuildInfo::DefineMap::const_iterator i=binfo.defines.begin(); i!=binfo.defines.end(); ++i)
}
if(binfo.threads)
argv.push_back("-pthread");
- if(comp.get_type()==Component::LIBRARY && architecture->get_system()!="windows")
+ if((comp.get_type()==Component::LIBRARY || comp.get_type()==Component::MODULE) && architecture->get_system()!="windows")
argv.push_back("-fPIC");
const Architecture &native_arch = builder.get_native_arch();