diff options
Diffstat (limited to 'src/externals_manual.cc')
-rw-r--r-- | src/externals_manual.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/externals_manual.cc b/src/externals_manual.cc new file mode 100644 index 0000000..afea257 --- /dev/null +++ b/src/externals_manual.cc @@ -0,0 +1,33 @@ +// -*- c++ -*- +// Distributed under the BSD 2-Clause License. +// See accompanying file LICENSE for details. +#include "externals_manual.h" + +#include <map> + +#include "libctor.h" +#include "settings.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, + const ExternalManual& ext, Flags& flags) +{ + flags = ext.flags; + + auto inc = external_includedir.find(name); + if(inc != external_includedir.end()) + { + flags.cflags.push_back("-I" + inc->second); + flags.cxxflags.push_back("-I" + inc->second); + } + + auto lib = external_libdir.find(name); + if(lib != external_libdir.end()) + { + flags.ldflags.push_back("-L" + lib->second); + } + + return 0; +} |