From d53486bf9c7d860141371c90d0dc1c923a350fed Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 13 Oct 2022 14:39:47 -0400 Subject: Add doc and release notes for cc.preprocess() --- docs/markdown/snippets/preprocess.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/markdown/snippets/preprocess.md (limited to 'docs/markdown/snippets/preprocess.md') diff --git a/docs/markdown/snippets/preprocess.md b/docs/markdown/snippets/preprocess.md new file mode 100644 index 0000000..7e6dd0a --- /dev/null +++ b/docs/markdown/snippets/preprocess.md @@ -0,0 +1,14 @@ +## New method to preprocess source files + +Compiler object has a new `preprocess()` method. It is supported by all C/C++ +compilers. It preprocess sources without compiling them. + +The preprocessor will receive the same arguments (include directories, defines, +etc) as with normal compilation. That includes for example args added with +`add_project_arguments()`, or on the command line with `-Dc_args=-DFOO`. + +```meson +cc = meson.get_compiler('c') +pp_files = cc.preprocess('foo.c', 'bar.c', output: '@PLAINNAME@') +exe = executable('app', pp_files) +``` -- cgit v1.1