queue.push_back(component);
while(!queue.empty())
{
- const Component *c = queue.front();
queue.erase(queue.begin());
- const BuildInfo &binfo = c->get_build_info();
+ BuildInfo binfo;
+ collect_build_info(binfo);
+
for(BuildInfo::WordList::const_iterator i=binfo.libs.begin(); i!=binfo.libs.end(); ++i)
{
if(i->size()>10 && !i->compare(i->size()-10, 10, ".framework"))
argv.push_back("-o");
argv.push_back(FS::relative(dynamic_cast<const FileTarget &>(tgt).get_path(), work_dir).str());
- const BuildInfo &binfo = comp.get_build_info();
+ BuildInfo binfo;
+ tgt.collect_build_info(binfo);
if(binfo.debug)
argv.push_back("-g");
if(binfo.optimize>0)
argv.push_back(executable->get_path().str());
argv.push_back("-c");
- const BuildInfo &binfo = comp.get_build_info_for_path(object.get_source().get_path());
+ BuildInfo binfo;
+ target.collect_build_info(binfo);
+
if(binfo.warning_level>=1)
{
argv.push_back("-Wall");
}
}
- const BuildInfo &binfo = comp.get_build_info();
+ BuildInfo binfo;
+ target.collect_build_info(binfo);
for(BuildInfo::PathList::const_iterator i=binfo.libpath.begin(); i!=binfo.libpath.end(); ++i)
argv.push_back("-L"+i->str());
if(binfo.strip)
return temp_dir/(FS::basepart(fn)+".o");
}
+void ObjectFile::collect_build_info(BuildInfo &binfo) const
+{
+ Target::collect_build_info(binfo);
+ binfo.update_from(component->get_build_info_for_path(source.get_path()));
+}
+
void ObjectFile::find_dependencies()
{
for(Dependencies::iterator i=depends.begin(); i!=depends.end(); ++i)
virtual const char *get_type() const { return "ObjectFile"; }
SourceFile &get_source() const { return source; }
+ virtual void collect_build_info(BuildInfo &) const;
+
private:
virtual void find_dependencies();
(*i)->set_tool(t);
}
+void Target::collect_build_info(BuildInfo &binfo) const
+{
+ if(component)
+ binfo.update_from(component->get_build_info());
+ else if(package)
+ binfo.update_from(package->get_build_info());
+}
+
void Target::force_rebuild()
{
if(!is_buildable())
#include <msp/time/timestamp.h>
class Builder;
+class BuildInfo;
class Component;
class SourcePackage;
class Task;
the build() function. */
const Tool *get_tool() const { return tool; }
+ virtual void collect_build_info(BuildInfo &) const;
+
/** Indicates if it's possible to build this target. */
bool is_buildable() const { return tool!=0; }