loader.load(parser);
}
+void Builder::save_caches()
+{
+ const PackageManager::PackageMap &packages = package_manager.get_packages();
+ for(PackageManager::PackageMap::const_iterator i=packages.begin(); i!=packages.end(); ++i)
+ i->second->save_caches();
+}
+
int Builder::build(unsigned jobs, bool dry_run, bool show_progress)
{
unsigned total = build_graph.count_rebuild_targets();
else if(show_progress)
get_logger().log("summary", "Build complete");
- if(!dry_run)
- {
- const PackageManager::PackageMap &packages = package_manager.get_packages();
- for(PackageManager::PackageMap::const_iterator i=packages.begin(); i!=packages.end(); ++i)
- i->second->save_caches();
- }
-
return fail;
}
configured. */
void load_build_file(const Msp::FS::Path &, const Config::InputOptions *opts = 0, bool all = false);
+ /** Saves package configuration and dependency caches. */
+ void save_caches();
+
/** Builds the goal targets. The build graph must be prepared first. */
int build(unsigned jobs = 1, bool dry_run = false, bool show_progress = false);
{
FS::Path main_file = cwd/build_file;
if(FS::exists(main_file))
+ {
builder.load_build_file(main_file, &cmdline_options, conf_all);
+ if(!dry_run && !cmdline_options.empty())
+ builder.save_caches();
+ }
else if(!help)
{
IO::print(IO::cerr, "The file %s does not exist.\n", main_file);
if(build)
exit_code = builder.build(jobs, dry_run, show_progress);
+ if(!dry_run)
+ builder.save_caches();
+
return exit_code;
}
for(ValueList::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
write_string(out, *j);
}
+
+ changed = false;
}
Msp::FS::Path filename;
DataMap data;
Msp::Time::TimeStamp mtime;
- bool changed;
+ mutable bool changed;
public:
Cache(SourcePackage &p);
for(OptionMap::const_iterator i=options.begin(); i!=options.end(); ++i)
IO::print(out, "option \"%s\" \"%s\";\n", i->second.name, i->second.value);
+
+ changed = false;
}
OptionMap options;
InputOptions pending_options;
Msp::Time::TimeStamp mtime;
- bool changed;
+ mutable bool changed;
public:
Config(SourcePackage &);