diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-07-10 17:24:16 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-07-15 10:11:05 +0200 |
commit | ae1871ca0ffcac3e8bd337f8d8bb4e7fd6c59295 (patch) | |
tree | d15df8a03fab6bdacebb6ba53c8ad30c290781fc /src/externals_manual.cc | |
parent | 2a55edcc40372403fb2de8ed20ed5c44464d416e (diff) |
Make tools abstraction around compiler options to better support tool agnostic arguments.
Diffstat (limited to 'src/externals_manual.cc')
-rw-r--r-- | src/externals_manual.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/externals_manual.cc b/src/externals_manual.cc index 79c9be3..0e3cdfd 100644 --- a/src/externals_manual.cc +++ b/src/externals_manual.cc @@ -7,25 +7,30 @@ #include "libctor.h" +#include "util.h" +#include "tools.h" + extern std::map<std::string, std::string> external_includedir; extern std::map<std::string, std::string> external_libdir; -int resolv(const Settings& settings, const std::string& name, +int resolv(const Settings& settings, const ExternalConfiguration& config, const ExternalManual& ext, Flags& flags) { + auto tool_chain = getToolChain(config.system); + flags = ext.flags; - auto inc = external_includedir.find(name); + auto inc = external_includedir.find(config.name); if(inc != external_includedir.end()) { - flags.cflags.push_back("-I" + inc->second); - flags.cxxflags.push_back("-I" + inc->second); + append(flags.cflags, getOption(tool_chain, opt::include_path, inc->second)); + append(flags.cxxflags, getOption(tool_chain, opt::include_path, inc->second)); } - auto lib = external_libdir.find(name); + auto lib = external_libdir.find(config.name); if(lib != external_libdir.end()) { - flags.ldflags.push_back("-L" + lib->second); + append(flags.ldflags, getOption(tool_chain, opt::library_path, lib->second)); } return 0; |