summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------grextras0
-rw-r--r--lib/jit_factory.cpp6
-rw-r--r--lib/module_loader.cpp8
3 files changed, 14 insertions, 0 deletions
diff --git a/grextras b/grextras
-Subproject 08a5747bff911f3c8722224d3d2a4f2f8fa68b1
+Subproject 3aa900e4908d82d222806a3a7d17faf94505d86
diff --git a/lib/jit_factory.cpp b/lib/jit_factory.cpp
index cdcfc03..882ee05 100644
--- a/lib/jit_factory.cpp
+++ b/lib/jit_factory.cpp
@@ -23,6 +23,9 @@
#include <fstream>
#include <map>
+//defined in module loader
+std::string get_gras_runtime_include_path(void);
+
/***********************************************************************
* Helper function to call a clang compliation
**********************************************************************/
@@ -60,6 +63,9 @@ static std::string call_clang(const std::string &source, const std::vector<std::
cmd.push_back(flag.c_str());
}
+ //root include path
+ cmd.push_back("-I"+get_gras_runtime_include_path());
+
//format command string
std::string command;
BOOST_FOREACH(const std::string &c, cmd)
diff --git a/lib/module_loader.cpp b/lib/module_loader.cpp
index d64722d..de3aa87 100644
--- a/lib/module_loader.cpp
+++ b/lib/module_loader.cpp
@@ -61,6 +61,14 @@ static std::string my_get_env(const std::string &name, const std::string &defalt
return (env_var != NULL)? env_var : defalt;
}
+//used by jit factory, but defined here for lazyness
+std::string get_gras_runtime_include_path(void)
+{
+ const std::string root = my_get_env("GRAS_ROOT", "@GRAS_ROOT@");
+ const fs::path inc_path = fs::path(root) / "include";
+ return inc_path.string();
+}
+
GRAS_STATIC_BLOCK(gras_module_loader)
{
//!search the GRAS_ROOT directory for this install