fix include_directories handling in subprojects for compiler tests.

pull/2595/head
Philipp Ittershagen 7 years ago committed by Jussi Pakkanen
parent 416a6fc235
commit a176588151
  1. 3
      mesonbuild/interpreter.py
  2. 9
      test cases/common/163 includedir subproj/meson.build
  3. 4
      test cases/common/163 includedir subproj/prog.c
  4. 2
      test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h
  5. 13
      test cases/common/163 includedir subproj/subprojects/inctest/meson.build

@ -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

@ -0,0 +1,9 @@
project('include dir in subproj test', 'c')
subproject('inctest')
exe = executable('prog', 'prog.c')
test('dummy', exe)

@ -0,0 +1,4 @@
int main(int argc, char **argv) {
return 0;
}

@ -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
Loading…
Cancel
Save