diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2023-09-22 13:40:35 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2023-09-25 13:05:04 -0700 |
| commit | d5546bdceaa2f3040d16a33fcbd824ba94b8cfde (patch) | |
| tree | 89578b4aaa9869e6a7b02de8955554445c175ecf /mesonbuild/modules | |
| parent | c1ac252f4ffecc381abe24e13584e1c48516e0eb (diff) | |
| download | meson-d5546bdceaa2f3040d16a33fcbd824ba94b8cfde.tar.gz | |
rust: apply global, project, and environment C args to bindgen
This means that arguments set via `add_global_arguments`,
`add_project_arguments` and by either the `-Dc_args` or `CFLAGS` are
applied to bindgen as well. This can be important when, among other
things, #defines are set via these mechanisms.
Fixes: #12065
Diffstat (limited to 'mesonbuild/modules')
| -rw-r--r-- | mesonbuild/modules/rust.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py index b6dd73149..382a72de9 100644 --- a/mesonbuild/modules/rust.py +++ b/mesonbuild/modules/rust.py @@ -236,6 +236,12 @@ class RustModule(ExtensionModule): elif isinstance(s, CustomTarget): depends.append(s) + clang_args.extend(state.global_args.get('c', [])) + clang_args.extend(state.project_args.get('c', [])) + cargs = state.get_option('args', state.subproject, lang='c') + assert isinstance(cargs, list), 'for mypy' + clang_args.extend(cargs) + if self._bindgen_bin is None: self._bindgen_bin = state.find_program('bindgen') |
