diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-10-30 18:02:10 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-10-30 18:02:10 +0200 |
commit | bc474f716407dec521626e76b6101df4a2f1a40a (patch) | |
tree | 2e7aa3ba12a1f65297225616ad4de59b181c932c /src/tasks.cc | |
parent | 7bf162fcd98920644e4f61ac0181037eb62c807e (diff) |
Add external configs.
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}); } } |