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/markdown/snippets/structured_sources.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/markdown/snippets/structured_sources.md (limited to 'docs/markdown') diff --git a/docs/markdown/snippets/structured_sources.md b/docs/markdown/snippets/structured_sources.md new file mode 100644 index 0000000..19fdc86 --- /dev/null +++ b/docs/markdown/snippets/structured_sources.md @@ -0,0 +1,26 @@ +## structured_sources() + +A new function, `structured_sources()` has been added. This function allows +languages like Rust which depend on the filesystem layout at compile time to mix +generated and static sources. + +```meson +executable( + 'main', + structured_sources( + 'main.rs, + {'mod' : generated_mod_rs}, + ) +) +``` + +Meson will then at build time copy the files into the build directory (if +necessary), so that the desired file structure is laid out, and compile that. In +this case: + +``` +root/ + main.rs + mod/ + mod.rs +``` -- cgit v1.1