Set resource-dir explicitly for genpybind-parse

This commit is contained in:
David Stöckel 2018-01-29 11:39:15 +01:00 committed by Yannik Stradmann
parent cc20b414b3
commit 0c16ab4f65
1 changed files with 12 additions and 1 deletions

View File

@ -29,6 +29,16 @@ def configure(cfg):
if not cfg.env.GENPYBIND:
cfg.find_program("genpybind", var="GENPYBIND")
# find clang reasource dir for builtin headers
cfg.env.GENPYBIND_RESOURCE_DIR = os.path.join(
cfg.cmd_and_log(cfg.env.LLVM_CONFIG + ["--libdir"]).strip(),
"clang",
cfg.cmd_and_log(cfg.env.LLVM_CONFIG + ["--version"]).strip())
if os.path.exists(cfg.env.GENPYBIND_RESOURCE_DIR):
cfg.msg("Checking clang resource dir", cfg.env.GENPYBIND_RESOURCE_DIR)
else:
cfg.fatal("Clang resource dir not found")
@feature("genpybind")
@before_method("process_source")
@ -78,7 +88,8 @@ class genpybind(Task.Task): # pylint: disable=invalid-name
if not self.inputs:
return
args = self.find_genpybind() + self._arguments()
args = self.find_genpybind() + self._arguments(
resource_dir=self.env.GENPYBIND_RESOURCE_DIR)
output = self.run_genpybind(args)