diff options
author | Matthias Klumpp <matthias@tenstral.net> | 2017-04-14 18:03:10 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-04-20 18:45:33 +0300 |
commit | 407130a1d2b83a624520ff1d5c7de82336362aed (patch) | |
tree | 94a91718d5aacb2de4022ef1db8388d9952ba1e1 | |
parent | 4588b910960c24fd61679124b6fd737c90e14c46 (diff) | |
download | meson-407130a1d2b83a624520ff1d5c7de82336362aed.zip meson-407130a1d2b83a624520ff1d5c7de82336362aed.tar.gz meson-407130a1d2b83a624520ff1d5c7de82336362aed.tar.bz2 |
Don't fail include_directories if the dir is only in the build path
-rw-r--r-- | mesonbuild/interpreter.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 649b842..ed08987 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2375,7 +2375,10 @@ class Interpreter(InterpreterBase): @stringArgs def func_include_directories(self, node, args, kwargs): src_root = self.environment.get_source_dir() - absbase = os.path.join(src_root, self.subdir) + build_root = self.environment.get_build_dir() + absbase_src = os.path.join(src_root, self.subdir) + absbase_build = os.path.join(build_root, self.subdir) + for a in args: if a.startswith(src_root): raise InvalidArguments('''Tried to form an absolute path to a source dir. You should not do that but use @@ -2395,8 +2398,9 @@ put in the include directories by default so you only need to do include_directories('.') if you intend to use the result in a different subdirectory. ''') - absdir = os.path.join(absbase, a) - if not os.path.isdir(absdir): + absdir_src = os.path.join(absbase_src, a) + absdir_build = os.path.join(absbase_build, a) + if not os.path.isdir(absdir_src) and not os.path.isdir(absdir_build): raise InvalidArguments('Include dir %s does not exist.' % a) is_system = kwargs.get('is_system', False) if not isinstance(is_system, bool): |