diff options
author | Philipp Ittershagen <pit@shgn.de> | 2017-10-25 19:58:57 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-11-08 21:18:48 +0200 |
commit | a176588151bd5809ed85929d5513cfd5a8791473 (patch) | |
tree | b4d379c96e552e43045d401d068ccd595b7d6239 | |
parent | 416a6fc2358c9077e73cf1cca45ff05579c0979c (diff) | |
download | meson-a176588151bd5809ed85929d5513cfd5a8791473.zip meson-a176588151bd5809ed85929d5513cfd5a8791473.tar.gz meson-a176588151bd5809ed85929d5513cfd5a8791473.tar.bz2 |
fix include_directories handling in subprojects for compiler tests.
5 files changed, 30 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 28cb5ad..b90a88c 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -696,7 +696,8 @@ class CompilerHolder(InterpreterObject): if not isinstance(i, IncludeDirsHolder): raise InterpreterException('Include directories argument must be an include_directories object.') for idir in i.held_object.get_incdirs(): - idir = os.path.join(self.environment.get_source_dir(), idir) + idir = os.path.join(self.environment.get_source_dir(), + i.held_object.get_curdir(), idir) args += self.compiler.get_include_args(idir, False) if not nobuiltins: opts = self.environment.coredata.compiler_options diff --git a/test cases/common/163 includedir subproj/meson.build b/test cases/common/163 includedir subproj/meson.build new file mode 100644 index 0000000..b3de5af --- /dev/null +++ b/test cases/common/163 includedir subproj/meson.build @@ -0,0 +1,9 @@ +project('include dir in subproj test', 'c') + + +subproject('inctest') + + +exe = executable('prog', 'prog.c') + +test('dummy', exe) diff --git a/test cases/common/163 includedir subproj/prog.c b/test cases/common/163 includedir subproj/prog.c new file mode 100644 index 0000000..772681e --- /dev/null +++ b/test cases/common/163 includedir subproj/prog.c @@ -0,0 +1,4 @@ + +int main(int argc, char **argv) { + return 0; +} diff --git a/test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h b/test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h new file mode 100644 index 0000000..ec740da --- /dev/null +++ b/test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h @@ -0,0 +1,2 @@ + +/* file which is used in the subproject */ diff --git a/test cases/common/163 includedir subproj/subprojects/inctest/meson.build b/test cases/common/163 includedir subproj/subprojects/inctest/meson.build new file mode 100644 index 0000000..74aabcb --- /dev/null +++ b/test cases/common/163 includedir subproj/subprojects/inctest/meson.build @@ -0,0 +1,13 @@ + +project('subproj with includedir', 'c') + + + +compile_check = ''' +#include "incfile.h" +''' + +if not meson.get_compiler('c').compiles(compile_check, name : 'include in subproj', + include_directories: include_directories('include')) + error('failed') +endif |