aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-02-10 12:39:12 -0500
committerXavier Claessens <xclaesse@gmail.com>2023-02-15 15:12:34 -0500
commitc2a55bfe43fae1b44cf49a083297d6755c89e1cc (patch)
tree8186d1f785861ac6b7da1e548034f05ba493472c /test cases/common
parent04f233a80d570c90c1a152114cbf3bdad6a61607 (diff)
downloadmeson-c2a55bfe43fae1b44cf49a083297d6755c89e1cc.zip
meson-c2a55bfe43fae1b44cf49a083297d6755c89e1cc.tar.gz
meson-c2a55bfe43fae1b44cf49a083297d6755c89e1cc.tar.bz2
preprocess: Allow custom_tgt, custom_idx and generated_list
It was documented to be supported but only File and str were actually working.
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/259 preprocess/bar.c2
-rw-r--r--test cases/common/259 preprocess/meson.build11
2 files changed, 11 insertions, 2 deletions
diff --git a/test cases/common/259 preprocess/bar.c b/test cases/common/259 preprocess/bar.c
index 43737b9..47d4ba1 100644
--- a/test cases/common/259 preprocess/bar.c
+++ b/test cases/common/259 preprocess/bar.c
@@ -1,3 +1,3 @@
-int bar(void) {
+int @BAR@(void) {
return BAR;
}
diff --git a/test cases/common/259 preprocess/meson.build b/test cases/common/259 preprocess/meson.build
index 4824598..9627b4f 100644
--- a/test cases/common/259 preprocess/meson.build
+++ b/test cases/common/259 preprocess/meson.build
@@ -4,7 +4,16 @@ cc = meson.get_compiler('c')
add_project_arguments(['-DFOO=0', '-DBAR=0'], language: 'c')
-pp_files = cc.preprocess('foo.c', 'bar.c', output: '@PLAINNAME@')
+fs = import('fs')
+bar_content = fs.read('bar.c')
+bar_c = custom_target(
+ input: 'bar.c',
+ output: 'bar.c',
+ command: ['python3', '-c', '''import sys;print(sys.argv[1].replace('@BAR@', 'bar'))''', bar_content],
+ capture: true,
+)
+
+pp_files = cc.preprocess('foo.c', bar_c, output: '@PLAINNAME@')
foreach f : pp_files
message(f.full_path())