diff options
Diffstat (limited to 'test cases/unit/94 custominc')
-rw-r--r-- | test cases/unit/94 custominc/easytogrepfor/genh.py | 7 | ||||
-rw-r--r-- | test cases/unit/94 custominc/easytogrepfor/meson.build | 3 | ||||
-rw-r--r-- | test cases/unit/94 custominc/helper.c | 5 | ||||
-rw-r--r-- | test cases/unit/94 custominc/meson.build | 9 | ||||
-rw-r--r-- | test cases/unit/94 custominc/prog.c | 9 | ||||
-rw-r--r-- | test cases/unit/94 custominc/prog2.c | 10 |
6 files changed, 43 insertions, 0 deletions
diff --git a/test cases/unit/94 custominc/easytogrepfor/genh.py b/test cases/unit/94 custominc/easytogrepfor/genh.py new file mode 100644 index 0000000..48e033a --- /dev/null +++ b/test cases/unit/94 custominc/easytogrepfor/genh.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +import sys + +f = open(sys.argv[1], 'w') +f.write('#define RETURN_VALUE 0') +f.close() diff --git a/test cases/unit/94 custominc/easytogrepfor/meson.build b/test cases/unit/94 custominc/easytogrepfor/meson.build new file mode 100644 index 0000000..e749753 --- /dev/null +++ b/test cases/unit/94 custominc/easytogrepfor/meson.build @@ -0,0 +1,3 @@ +genh = custom_target('header', + output: 'generated.h', + command: [find_program('genh.py'), '@OUTPUT@']) diff --git a/test cases/unit/94 custominc/helper.c b/test cases/unit/94 custominc/helper.c new file mode 100644 index 0000000..3237441 --- /dev/null +++ b/test cases/unit/94 custominc/helper.c @@ -0,0 +1,5 @@ +#include<generated.h> + +int func(void) { + return RETURN_VALUE; +} diff --git a/test cases/unit/94 custominc/meson.build b/test cases/unit/94 custominc/meson.build new file mode 100644 index 0000000..bab1139 --- /dev/null +++ b/test cases/unit/94 custominc/meson.build @@ -0,0 +1,9 @@ +project('implicit custom dirs', 'c') + +subdir('easytogrepfor') + +l = static_library('helper', 'helper.c', genh) +d = declare_dependency(link_with: l, sources: genh) +executable('prog', 'prog.c', dependencies: d, implicit_include_directories: false) + +executable('prog2', 'prog2.c', dependencies: d) diff --git a/test cases/unit/94 custominc/prog.c b/test cases/unit/94 custominc/prog.c new file mode 100644 index 0000000..db9df9d --- /dev/null +++ b/test cases/unit/94 custominc/prog.c @@ -0,0 +1,9 @@ +#include<stdlib.h> + +int func(void); + +int main(int argc, char **argv) { + (void)argc; + (void)(argv); + return func(); +} diff --git a/test cases/unit/94 custominc/prog2.c b/test cases/unit/94 custominc/prog2.c new file mode 100644 index 0000000..e64b229 --- /dev/null +++ b/test cases/unit/94 custominc/prog2.c @@ -0,0 +1,10 @@ +#include<stdlib.h> +#include<generated.h> + +int func(void); + +int main(int argc, char **argv) { + (void)argc; + (void)(argv); + return func() + RETURN_VALUE; +} |