From bb875280b695b8d0435833c192f99233e74a522a Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 17 Nov 2022 11:09:29 -0800 Subject: modules/rust: Add support for string include_directories Which we support for basically every other case, but not this one. --- docs/markdown/Rust-module.md | 8 ++++---- docs/markdown/snippets/rust_bindgen_str_include.md | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 docs/markdown/snippets/rust_bindgen_str_include.md (limited to 'docs/markdown') diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md index 3ca530225..e2c455e71 100644 --- a/docs/markdown/Rust-module.md +++ b/docs/markdown/Rust-module.md @@ -3,7 +3,7 @@ short-description: Rust language integration module authors: - name: Dylan Baker email: dylan@pnwbakers.com - years: [2020, 2021] + years: [2020, 2021, 2022] ... # Rust module @@ -35,7 +35,7 @@ that automatically. Additional, test only dependencies may be passed via the dependencies argument. -### bindgen(*, input: string | BuildTarget | [](string | BuildTarget), output: string, include_directories: []include_directories, c_args: []string, args: []string) +### bindgen(*, input: string | BuildTarget | [](string | BuildTarget), output: string, include_directories: [](include_directories | string), c_args: []string, args: []string) This function wraps bindgen to simplify creating rust bindings around C libraries. This has two advantages over hand-rolling ones own with a @@ -50,8 +50,8 @@ It takes the following keyword arguments - input — A list of Files, Strings, or CustomTargets. The first element is the header bindgen will parse, additional elements are dependencies. - output — the name of the output rust file -- include_directories — A list of `include_directories` objects, these are - passed to clang as `-I` arguments +- include_directories — A list of `include_directories` or `string` objects, + these are passed to clang as `-I` arguments *(string since 1.0.0)* - c_args — A list of string arguments to pass to clang untouched - args — A list of string arguments to pass to `bindgen` untouched. diff --git a/docs/markdown/snippets/rust_bindgen_str_include.md b/docs/markdown/snippets/rust_bindgen_str_include.md new file mode 100644 index 000000000..aad5da9b9 --- /dev/null +++ b/docs/markdown/snippets/rust_bindgen_str_include.md @@ -0,0 +1,4 @@ +## String arguments to the rust.bindgen include_directories argument + +Most other cases of include_directories accept strings as well as +`IncludeDirectory` objects, so lets do that here too for consistancy. -- cgit v1.2.3