From c2a55bfe43fae1b44cf49a083297d6755c89e1cc Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 10 Feb 2023 12:39:12 -0500 Subject: preprocess: Allow custom_tgt, custom_idx and generated_list It was documented to be supported but only File and str were actually working. --- test cases/common/259 preprocess/bar.c | 2 +- test cases/common/259 preprocess/meson.build | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'test cases/common') 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()) -- cgit v1.1