diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-23 00:45:51 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-23 00:45:51 +0300 |
| commit | 8e403e08ac2907214c044c804ee5eef6a45e0ff9 (patch) | |
| tree | fd52448309363d015ca4aea30a5aa00582cc56bf /docs/markdown/Wrap-best-practices-and-tips.md | |
| parent | 77a933faca44a9629895959ad44dd835ee673fd5 (diff) | |
| download | meson-8e403e08ac2907214c044c804ee5eef6a45e0ff9.tar.gz | |
Use library() instead of rolling your own. [skip ci]
Diffstat (limited to 'docs/markdown/Wrap-best-practices-and-tips.md')
| -rw-r--r-- | docs/markdown/Wrap-best-practices-and-tips.md | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/docs/markdown/Wrap-best-practices-and-tips.md b/docs/markdown/Wrap-best-practices-and-tips.md index d7bd15037..5fddb5d53 100644 --- a/docs/markdown/Wrap-best-practices-and-tips.md +++ b/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 |
