summaryrefslogtreecommitdiff
path: root/docs/markdown/Rust-module.md
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-06-21 12:15:07 -0700
committerDylan Baker <dylan@pnwbakers.com>2023-06-27 11:53:18 -0700
commitc5b16ab8b957d53b75c73bb24144a4f61c86234d (patch)
treed4ada77ecd56f09ea3996a39a60cae4dd6b156f4 /docs/markdown/Rust-module.md
parent43f24060f3e0065b44b1909d88bcc8e2882e9e5e (diff)
downloadmeson-c5b16ab8b957d53b75c73bb24144a4f61c86234d.tar.gz
modules/rust: Add a machine file property for extra clang args with bindgen
It's currently impossible to inject extra clang arguments when using bindgen, which is problematic when cross compiling since you may need critical arguments like `--target=...`. Because such arguments must be passed after the `--` it's impossible to inject them currently without going to something like a wrapper script. Fixes: #11805
Diffstat (limited to 'docs/markdown/Rust-module.md')
-rw-r--r--docs/markdown/Rust-module.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md
index 512c4ec96..30a63455b 100644
--- a/docs/markdown/Rust-module.md
+++ b/docs/markdown/Rust-module.md
@@ -86,10 +86,17 @@ r1 = rust.bindgen(
)
```
-
*Since 1.1.0* Meson will synchronize assertions for Rust and C/C++ when the
`b_ndebug` option is set (via `-DNDEBUG` for C/C++, and `-C
debug-assertions=on` for Rust), and will pass `-DNDEBUG` as an extra argument
to clang. This allows for reliable wrapping of `-DNDEBUG` controlled behavior
with `#[cfg(debug_asserions)]` and or `cfg!()`. Before 1.1.0, assertions for Rust
were never turned on by Meson.
+
+*Since 1.2.0* Additional arguments to pass to clang may be specified in a
+*machine file in the properties section:
+
+```ini
+[properties]
+bindgen_clang_arguments = ['--target', 'x86_64-linux-gnu']
+```