aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/structured_sources.md
blob: 19fdc86f28534e0fb1b27ab73359f532d2032fcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
```