summaryrefslogtreecommitdiff
path: root/src/externals_manual.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-05-23 18:46:13 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-06-06 10:21:43 +0200
commite9023132d506a9223d6c7c315a3cdf118effd30e (patch)
tree93e97fd0d04b0604d134918a1d194f2e282a3c03 /src/externals_manual.cc
parent1523880f97eab00120c029d55bab47252f31f166 (diff)
Added support for manual externals (inherit flags and set include/lib paths from configure).
Diffstat (limited to 'src/externals_manual.cc')
-rw-r--r--src/externals_manual.cc33
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;
+}