summaryrefslogtreecommitdiff
path: root/src/tasks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasks.cc')
-rw-r--r--src/tasks.cc55
1 files changed, 30 insertions, 25 deletions
diff --git a/src/tasks.cc b/src/tasks.cc
index 3bfff8b..8ab296f 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -18,7 +18,8 @@
#include "rebuild.h"
#include "configure.h"
-const std::deque<Target>& getTargets(const Settings& settings)
+const std::deque<Target>& getTargets(const Settings& settings,
+ bool resolve_externals)
{
static bool initialised{false};
static std::deque<Target> targets;
@@ -36,31 +37,34 @@ const std::deque<Target>& getTargets(const Settings& settings)
auto configs = configFiles[i].cb();
for(auto& config : configs)
{
- // Resolv config externals
- for(const auto& external : config.externals)
+ if(resolve_externals)
{
- if(externals.find(external) == externals.end())
+ // Resolv config externals
+ for(const auto& external : config.externals)
{
- std::cout << "External '" << external <<
- "' not found cache - run configure.\n";
- continue;
+ if(externals.find(external) == externals.end())
+ {
+ std::cout << "External '" << external <<
+ "' not found in cache - run configure.\n";
+ exit(1);
+ }
+ const auto& flags = externals.at(external);
+ config.flags.cflags.insert(config.flags.cflags.end(),
+ flags.cflags.begin(),
+ flags.cflags.end());
+ config.flags.cxxflags.insert(config.flags.cxxflags.end(),
+ flags.cxxflags.begin(),
+ flags.cxxflags.end());
+ config.flags.ldflags.insert(config.flags.ldflags.end(),
+ flags.ldflags.begin(),
+ flags.ldflags.end());
+ config.flags.asmflags.insert(config.flags.asmflags.end(),
+ flags.asmflags.begin(),
+ flags.asmflags.end());
+ //config.libs.insert(config.libs.end(),
+ // libs.begin(),
+ // libs.end());
}
- const auto& flags = externals.at(external);
- config.flags.cflags.insert(config.flags.cflags.end(),
- flags.cflags.begin(),
- flags.cflags.end());
- config.flags.cxxflags.insert(config.flags.cxxflags.end(),
- flags.cxxflags.begin(),
- flags.cxxflags.end());
- config.flags.ldflags.insert(config.flags.ldflags.end(),
- flags.ldflags.begin(),
- flags.ldflags.end());
- config.flags.asmflags.insert(config.flags.asmflags.end(),
- flags.asmflags.begin(),
- flags.asmflags.end());
- //config.libs.insert(config.libs.end(),
- // libs.begin(),
- // libs.end());
}
targets.push_back({config, path});
@@ -169,9 +173,10 @@ std::shared_ptr<Task> getNextTask(const std::list<std::shared_ptr<Task>>& allTas
}
std::list<std::shared_ptr<Task>> getTasks(const Settings& settings,
- const std::vector<std::string> names)
+ const std::vector<std::string> names,
+ bool resolve_externals)
{
- auto& targets = getTargets(settings);
+ auto& targets = getTargets(settings, resolve_externals);
std::list<std::shared_ptr<Task>> tasks;
for(const auto& target : targets)
{