diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-28 02:13:06 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-28 02:13:06 +0200 |
commit | f9c63999c3b844c7f00b6b2853751724f20a304c (patch) | |
tree | b278a1d7ba59344d973a294137c1dd25fe82e057 | |
parent | 98ce4539a9f4e96b348cfc33d5a16b424ea36ec3 (diff) | |
download | meson-f9c63999c3b844c7f00b6b2853751724f20a304c.zip meson-f9c63999c3b844c7f00b6b2853751724f20a304c.tar.gz meson-f9c63999c3b844c7f00b6b2853751724f20a304c.tar.bz2 |
Put build directories in #include path.
-rwxr-xr-x | interpreter.py | 1 | ||||
-rwxr-xr-x | shellgenerator.py | 16 | ||||
-rw-r--r-- | test cases/28 config subdir/builder.txt | 6 | ||||
-rw-r--r-- | test cases/28 config subdir/include/builder.txt | 2 | ||||
-rw-r--r-- | test cases/28 config subdir/include/config.h.in | 6 | ||||
-rw-r--r-- | test cases/28 config subdir/src/builder.txt | 3 | ||||
-rw-r--r-- | test cases/28 config subdir/src/prog.c | 5 |
7 files changed, 33 insertions, 6 deletions
diff --git a/interpreter.py b/interpreter.py index 6fa3c62..1ff27bc 100755 --- a/interpreter.py +++ b/interpreter.py @@ -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 diff --git a/shellgenerator.py b/shellgenerator.py index aa41c14..6ca1666 100755 --- a/shellgenerator.py +++ b/shellgenerator.py @@ -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() diff --git a/test cases/28 config subdir/builder.txt b/test cases/28 config subdir/builder.txt new file mode 100644 index 0000000..25f53db --- /dev/null +++ b/test cases/28 config subdir/builder.txt @@ -0,0 +1,6 @@ +project('subdirconfig', 'c') + +inc = include_directories('include') + +subdir('include') +subdir('src') diff --git a/test cases/28 config subdir/include/builder.txt b/test cases/28 config subdir/include/builder.txt new file mode 100644 index 0000000..8fb3282 --- /dev/null +++ b/test cases/28 config subdir/include/builder.txt @@ -0,0 +1,2 @@ +number = '0' +configure_file('config.h.in', 'config.h') diff --git a/test cases/28 config subdir/include/config.h.in b/test cases/28 config subdir/include/config.h.in new file mode 100644 index 0000000..4c3c62d --- /dev/null +++ b/test cases/28 config subdir/include/config.h.in @@ -0,0 +1,6 @@ +#ifndef CONFIG_H_ +#define CONFIG_H_ + +#define RETURN_VALUE @number@ + +#endif diff --git a/test cases/28 config subdir/src/builder.txt b/test cases/28 config subdir/src/builder.txt new file mode 100644 index 0000000..fd41b43 --- /dev/null +++ b/test cases/28 config subdir/src/builder.txt @@ -0,0 +1,3 @@ +exe = executable('prog', 'prog.c') +exe.add_include_dirs(inc) +add_test('subdir config', exe) diff --git a/test cases/28 config subdir/src/prog.c b/test cases/28 config subdir/src/prog.c new file mode 100644 index 0000000..4c03c20 --- /dev/null +++ b/test cases/28 config subdir/src/prog.c @@ -0,0 +1,5 @@ +#include "config.h" + +int main(int argc, char **argv) { + return RETURN_VALUE; +} |