From 254d7e1c48f3a2d0837439f07628cfd54e47367b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sun, 26 Oct 2025 09:15:54 +0100 Subject: rust: add to_system_dependency Move the logic for system dependencies outside Cargo.interpreter and into the rust module, so that it can be reused by the workspace object. Signed-off-by: Paolo Bonzini --- docs/markdown/Rust-module.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/markdown/Rust-module.md') diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md index b1edb793c..37ba59d8e 100644 --- a/docs/markdown/Rust-module.md +++ b/docs/markdown/Rust-module.md @@ -172,6 +172,21 @@ Only a subset of [[shared_library]] keyword arguments are allowed: - link_with - override_options +### to_system_dependency() + +*Since 1.11.0* + +```meson +rustmod.to_system_dependency(dep[, name]) +``` + +Create and return an internal dependency that wraps `dep` and +defines `cfg(system_deps_have_NAME)`. This is compatible with +how the `system-deps` crate reports the availability of a system +dependency to Rust code. + +If omitted, the name defaults to the name of the dependency. + ### workspace() Basic usage: -- cgit v1.2.3