structured_sources()

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.

Signature

(since 0.62.0)

# Create a StructuredSource object, which is opaque and may be passed as a source
structured_src structured_sources(
  array[str | file | custom_tgt | custom_idx | generated_list] root,           # Sources to put at the root of the generated structure
  dict[str | file | custom_tgt | custom_idx | generated_list]  [additional],   # Additional sources, where the key is the directory under the root to place
)

Arguments

The function structured_sources() accepts the following positional arguments:

Name Type Description Tags
root array[str | file | custom_tgt | custom_idx | generated_list]

Sources to put at the root of the generated structure

additional dict[str | file | custom_tgt | custom_idx | generated_list]

Additional sources, where the key is the directory under the root to place the values

[optional]

The results of the search are