Put build directories in #include path.

pull/15/head
Jussi Pakkanen 12 years ago
parent 98ce4539a9
commit f9c63999c3
  1. 1
      interpreter.py
  2. 16
      shellgenerator.py
  3. 6
      test cases/28 config subdir/builder.txt
  4. 2
      test cases/28 config subdir/include/builder.txt
  5. 6
      test cases/28 config subdir/include/config.h.in
  6. 3
      test cases/28 config subdir/src/builder.txt
  7. 5
      test cases/28 config subdir/src/prog.c

@ -572,6 +572,7 @@ class Interpreter():
isinstance(value, environment.PkgConfigDependency) or\
isinstance(value, nodes.StringStatement) or\
isinstance(value, nodes.BoolStatement) or\
isinstance(value, nodes.IntStatement) or\
isinstance(value, list):
return True
return False

@ -116,9 +116,10 @@ echo Run compile.sh before this or bad things will happen.
infile = os.path.join(self.environment.get_source_dir(),
cf.get_subdir(),
cf.get_source_name())
# FIXME, put in in the proper path.
outfile = os.path.join(self.environment.get_build_dir(),
cf.get_target_name())
outdir = os.path.join(self.environment.get_build_dir(),
cf.get_subdir())
os.makedirs(outdir, exist_ok=True)
outfile = os.path.join(outdir, cf.get_target_name())
do_conf_file(infile, outfile, self.interpreter.get_variables())
def generate_data_install(self, outfile):
@ -242,9 +243,12 @@ echo Run compile.sh before this or bad things will happen.
for i in target.get_include_dirs():
basedir = i.get_curdir()
for d in i.get_incdirs():
fulldir = os.path.join(self.environment.get_source_dir(), basedir, d)
arg = compiler.get_include_arg(fulldir)
commands.append(arg)
expdir = os.path.join(basedir, d)
fulldir = os.path.join(self.environment.get_source_dir(), expdir)
barg = compiler.get_include_arg(expdir)
sarg = compiler.get_include_arg(fulldir)
commands.append(barg)
commands.append(sarg)
commands += self.get_pch_include_args(compiler, target)
commands.append(abs_src)
commands += compiler.get_output_flags()

@ -0,0 +1,6 @@
project('subdirconfig', 'c')
inc = include_directories('include')
subdir('include')
subdir('src')

@ -0,0 +1,2 @@
number = '0'
configure_file('config.h.in', 'config.h')

@ -0,0 +1,6 @@
#ifndef CONFIG_H_
#define CONFIG_H_
#define RETURN_VALUE @number@
#endif

@ -0,0 +1,3 @@
exe = executable('prog', 'prog.c')
exe.add_include_dirs(inc)
add_test('subdir config', exe)

@ -0,0 +1,5 @@
#include "config.h"
int main(int argc, char **argv) {
return RETURN_VALUE;
}
Loading…
Cancel
Save