diff options
Diffstat (limited to 'src/tasks.cc')
-rw-r--r-- | src/tasks.cc | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/tasks.cc b/src/tasks.cc index 56988f9..8efc98e 100644 --- a/src/tasks.cc +++ b/src/tasks.cc @@ -23,6 +23,17 @@ const std::deque<Target>& getTargets(const Settings& settings) static std::deque<Target> targets; if(!initialised) { + + // Generate externals + std::vector<ExternalConfiguration> externalConfigs; + for(std::size_t i = 0; i < numExternalConfigFiles; ++i) + { + auto newExternalConfigs = externalConfigFiles[i].cb(); + externalConfigs.insert(externalConfigs.end(), + newExternalConfigs.begin(), + newExternalConfigs.end()); + } + for(std::size_t i = 0; i < numConfigFiles; ++i) { std::string path = @@ -32,8 +43,42 @@ const std::deque<Target>& getTargets(const Settings& settings) std::cout << configFiles[i].file << " in path " << path << "\n"; } auto configs = configFiles[i].cb(); - for(const auto& config : configs) + 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; + config.cflags.insert(config.cflags.end(), + externalConfig.cflags.begin(), + externalConfig.cflags.end()); + config.cxxflags.insert(config.cxxflags.end(), + externalConfig.cxxflags.begin(), + externalConfig.cxxflags.end()); + config.ldflags.insert(config.ldflags.end(), + externalConfig.ldflags.begin(), + externalConfig.ldflags.end()); + config.asmflags.insert(config.asmflags.end(), + externalConfig.asmflags.begin(), + externalConfig.asmflags.end()); + } + } + if(!found) + { + std::cout << "External '" << external << "' not found.\n"; + exit(1); + } + + } + + targets.push_back({config, path}); } } |