summaryrefslogtreecommitdiff
path: root/src/tasks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasks.cc')
-rw-r--r--src/tasks.cc99
1 files changed, 21 insertions, 78 deletions
diff --git a/src/tasks.cc b/src/tasks.cc
index 8a85fc8..3bfff8b 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -24,18 +24,7 @@ const std::deque<Target>& getTargets(const Settings& settings)
static std::deque<Target> targets;
if(!initialised)
{
- // TODO: Centralize
- // Resolv externals
- ExternalConfigurations externalConfigs;
- for(std::size_t i = 0; i < numExternalConfigFiles; ++i)
- {
- auto newExternalConfigs = externalConfigFiles[i].cb();
- externalConfigs.insert(externalConfigs.end(),
- newExternalConfigs.begin(),
- newExternalConfigs.end());
- }
-
- const auto& extMap = configuration().externals;
+ const auto& externals = configuration().externals;
for(std::size_t i = 0; i < numConfigFiles; ++i)
{
std::string path =
@@ -47,77 +36,31 @@ 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)
{
- bool found{false};
- for(const auto& externalConfig : externalConfigs)
- {
- if(externalConfig.name == external)
- {
- found = true;
- try
- {
- auto cflags = extMap.at(external+"-cflags");
- config.cflags.insert(config.cflags.end(),
- cflags.begin(),
- cflags.end());
- }
- catch(...)
- {
- }
-
- try
- {
- auto cxxflags = extMap.at(external+"-cxxflags");
- config.cxxflags.insert(config.cxxflags.end(),
- cxxflags.begin(),
- cxxflags.end());
- }
- catch(...)
- {
- }
-
- try
- {
- auto ldflags = extMap.at(external+"-ldflags");
- config.ldflags.insert(config.ldflags.end(),
- ldflags.begin(),
- ldflags.end());
- }
- catch(...)
- {
- }
-
- try
- {
- auto asmflags = extMap.at(external+"-asmflags");
- config.asmflags.insert(config.asmflags.end(),
- asmflags.begin(),
- asmflags.end());
- }
- catch(...)
- {
- }
-
- try
- {
- auto libs = extMap.at(external+"-libs");
- //config.libs.insert(config.libs.end(),
- // libs.begin(),
- // libs.end());
- }
- catch(...)
- {
- }
- }
- }
- if(!found)
+ if(externals.find(external) == externals.end())
{
- std::cout << "External '" << external << "' not found.\n";
- exit(1);
+ std::cout << "External '" << external <<
+ "' not found cache - run configure.\n";
+ continue;
}
+ 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});