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 optimization. However building both library types on all builds is
slow and wasteful. slow and wasteful.
Your project should provide a toggle specifying which type of library Your project should use the `library` method that can be toggled
it should build. As an example if you have a Meson option called between shared and static with the `defaul_library` builtin option.
`shared_lib` then you could do this:
```meson ```meson
if get_option('shared_lib') mylib = library('foo', 'foo.c')
libtype = 'shared_library'
else
libtype = 'static_library'
endif
mylib = build_target('foo', 'foo.c',
target_type : libtype)
``` ```
## Declare generated headers explicitly ## Declare generated headers explicitly

Loading…
Cancel
Save