summaryrefslogtreecommitdiff
path: root/src/externals_manual.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/externals_manual.cc')
-rw-r--r--src/externals_manual.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/externals_manual.cc b/src/externals_manual.cc
new file mode 100644
index 0000000..0e3cdfd
--- /dev/null
+++ b/src/externals_manual.cc
@@ -0,0 +1,37 @@
+// -*- c++ -*-
+// Distributed under the BSD 2-Clause License.
+// See accompanying file LICENSE for details.
+#include "externals_manual.h"
+
+#include <map>
+
+#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 ExternalConfiguration& config,
+ const ExternalManual& ext, Flags& flags)
+{
+ auto tool_chain = getToolChain(config.system);
+
+ flags = ext.flags;
+
+ auto inc = external_includedir.find(config.name);
+ if(inc != external_includedir.end())
+ {
+ 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(config.name);
+ if(lib != external_libdir.end())
+ {
+ append(flags.ldflags, getOption(tool_chain, opt::library_path, lib->second));
+ }
+
+ return 0;
+}