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 /test cases/rust/12 bindgen/src | |
| 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 'test cases/rust/12 bindgen/src')
| -rw-r--r-- | test cases/rust/12 bindgen/src/global-project.h | 10 | ||||
| -rw-r--r-- | test cases/rust/12 bindgen/src/global.c | 5 | ||||
| -rw-r--r-- | test cases/rust/12 bindgen/src/global.rs | 14 |
3 files changed, 29 insertions, 0 deletions
diff --git a/test cases/rust/12 bindgen/src/global-project.h b/test cases/rust/12 bindgen/src/global-project.h new file mode 100644 index 000000000..6084e8ed6 --- /dev/null +++ b/test cases/rust/12 bindgen/src/global-project.h @@ -0,0 +1,10 @@ +#ifndef GLOBAL_ARG +char * success(void); +#endif +#ifndef PROJECT_ARG +char * success(void); +#endif +#ifndef CMD_ARG +char * success(void); +#endif +int success(void); diff --git a/test cases/rust/12 bindgen/src/global.c b/test cases/rust/12 bindgen/src/global.c new file mode 100644 index 000000000..10f6676f7 --- /dev/null +++ b/test cases/rust/12 bindgen/src/global.c @@ -0,0 +1,5 @@ +#include "src/global-project.h" + +int success(void) { + return 0; +} diff --git a/test cases/rust/12 bindgen/src/global.rs b/test cases/rust/12 bindgen/src/global.rs new file mode 100644 index 000000000..4b70b1ecc --- /dev/null +++ b/test cases/rust/12 bindgen/src/global.rs @@ -0,0 +1,14 @@ +// SPDX-license-identifer: Apache-2.0 +// Copyright © 2023 Intel Corporation + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +include!("global-project.rs"); + +fn main() { + unsafe { + std::process::exit(success()); + }; +} |
