summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorStas Sergeev <stsp2@yandex.ru>2024-01-13 17:17:43 +0500
committerDylan Baker <dylan@pnwbakers.com>2024-01-17 13:37:36 -0800
commit92f638e1f9a9306a4296631cbc8f97c253e6ba88 (patch)
tree6049cb8a9df4da0e2072073f57668cb203b5b39c /test cases
parent1ca2c74d16c3f5987f686e358b58ce5d2253ce9b (diff)
downloadmeson-92f638e1f9a9306a4296631cbc8f97c253e6ba88.tar.gz
compiler.preprocess: add depends kwarg
This patch adds 'depends' keyword to compiler.preprocess(). It allows to execute other targets before doing the preprocessing. Test-case is added to demonstrate that functionality: it generates the header before preprocessing the C source that uses that generated header. Thanks to @bruchar1 for getting this patch to work.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/259 preprocess/foo.x (renamed from test cases/common/259 preprocess/foo.h)0
-rw-r--r--test cases/common/259 preprocess/meson.build7
2 files changed, 6 insertions, 1 deletions
diff --git a/test cases/common/259 preprocess/foo.h b/test cases/common/259 preprocess/foo.x
index ba60bf396..ba60bf396 100644
--- a/test cases/common/259 preprocess/foo.h
+++ b/test cases/common/259 preprocess/foo.x
diff --git a/test cases/common/259 preprocess/meson.build b/test cases/common/259 preprocess/meson.build
index 10e8b0984..40168f95d 100644
--- a/test cases/common/259 preprocess/meson.build
+++ b/test cases/common/259 preprocess/meson.build
@@ -13,9 +13,14 @@ bar_x = custom_target(
capture: true,
)
+foo_h = import('fs').copyfile('foo.x', 'foo.h')
+
dep = declare_dependency(compile_args: '-DPLOP=0')
-pp_files = cc.preprocess('foo.c', bar_x, 'math.c', output: '@PLAINNAME@.c', dependencies: dep)
+pp_files = cc.preprocess('foo.c', bar_x, 'math.c',
+ output: '@PLAINNAME@.c',
+ dependencies: dep,
+ depends: foo_h)
foreach f : pp_files
message(f.full_path())