From 9cf7a125613f8cc929828780b8c7aefd0d3ee4ac Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 4 Mar 2022 15:26:50 -0800 Subject: docs: Add docs for structured_sources --- docs/yaml/functions/_build_target_base.yaml | 2 +- docs/yaml/functions/structured_sources.yaml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 docs/yaml/functions/structured_sources.yaml (limited to 'docs/yaml/functions') diff --git a/docs/yaml/functions/_build_target_base.yaml b/docs/yaml/functions/_build_target_base.yaml index 68df5d8..4db37f4 100644 --- a/docs/yaml/functions/_build_target_base.yaml +++ b/docs/yaml/functions/_build_target_base.yaml @@ -49,7 +49,7 @@ kwargs: eg: `cpp_args` for C++ sources: - type: str | file | custom_tgt | custom_idx | generated_list + type: str | file | custom_tgt | custom_idx | generated_list | structured_src description: Additional source files. Same as the source varargs. build_by_default: diff --git a/docs/yaml/functions/structured_sources.yaml b/docs/yaml/functions/structured_sources.yaml new file mode 100644 index 0000000..a5f0a83 --- /dev/null +++ b/docs/yaml/functions/structured_sources.yaml @@ -0,0 +1,21 @@ +name: structured_sources +returns: structured_src +since: 0.62.0 +description: | + Create a StructuredSource object, which is opaque and may be passed as a source + to any build_target (including static_library, shared_library, executable, + etc.). This is useful for languages like Rust, which use the filesystem layout + to determine import names. This is only allowed in Rust targets, and cannot be + mixed with non structured inputs. + +posargs: + root: + type: list[str | file | custom_tgt | custom_idx | generated_list] + description: Sources to put at the root of the generated structure + +optargs: + additional: + type: dict[str | file | custom_tgt | custom_idx | generated_list] + description: | + Additional sources, where the key is the directory under the root to place + the values -- cgit v1.1