From 01420bf8fc1ee6c1466e2fa4c9805267192dce26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 13 Apr 2023 23:04:51 +0300 Subject: rust: Add new `rust_dependency_map` target configuration This allows changing the crate name with which a library ends up being available inside the Rust code, similar to cargo's dependency renaming feature or `extern crate foo as bar` inside Rust code. --- docs/markdown/snippets/rust_dependency_map.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/markdown/snippets/rust_dependency_map.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/rust_dependency_map.md b/docs/markdown/snippets/rust_dependency_map.md new file mode 100644 index 0000000..62c9dae --- /dev/null +++ b/docs/markdown/snippets/rust_dependency_map.md @@ -0,0 +1,18 @@ +## Support for defining crate names of Rust dependencies in Rust targets + +Rust supports defining a different crate name for a dependency than what the +actual crate name during compilation of that dependency was. + +This allows using multiple versions of the same crate at once, or simply using +a shorter name of the crate for convenience. + +```meson +a_dep = dependency('some-very-long-name') + +my_executable = executable('my-executable', 'src/main.rs', + rust_dependency_map : { + 'some_very_long_name' : 'a', + }, + dependencies : [a_dep], +) +``` -- cgit v1.1