Use library() instead of rolling your own. [skip ci]

pull/5417/head
Jussi Pakkanen 6 years ago
parent 77a933faca
commit 8e403e08ac
  1. 15
      docs/markdown/Wrap-best-practices-and-tips.md

@ -47,19 +47,12 @@ also faster during development due to Meson's relinking
optimization. However building both library types on all builds is
slow and wasteful.
Your project should provide a toggle specifying which type of library
it should build. As an example if you have a Meson option called
`shared_lib` then you could do this:
Your project should use the `library` method that can be toggled
between shared and static with the `defaul_library` builtin option.
```meson
if get_option('shared_lib')
libtype = 'shared_library'
else
libtype = 'static_library'
endif
mylib = build_target('foo', 'foo.c',
target_type : libtype)
mylib = library('foo', 'foo.c')
```
## Declare generated headers explicitly

Loading…
Cancel
Save