Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add meson instructions to usage docs #3677

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,44 @@ For ``build2`` newcomers or to get more details and use cases, you can read the
``build2``
`toolchain introduction <https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml>`_.

Usage with Meson
================

`Meson's WrapDB <https://mesonbuild.com/Wrapdb-projects.html>` includes a ``fmt``
package, which repackages fmt to be built by Meson as a subproject.

**Usage:**

- Install the ``fmt`` subproject from the WrapDB by running::

meson wrap install fmt

from the root of your project.

- In your project's ``meson.build`` file, add an entry for the new subproject::

fmt = subproject('fmt')
fmt_dep = fmt.get_variable('fmt_dep')

- Include the new dependency object to link with fmt::

my_build_target = executable('name', 'src/main.cc', dependencies: [fmt_dep])

**Options:**

If desired, ``fmt`` may be built as a static library, or as a header-only
library.

For a static build, use the following subproject definition::

fmt = subproject('fmt', default_options: 'default_library=static')
fmt_dep = fmt.get_variable('fmt_dep')

For the header-only version, use::

fmt = subproject('fmt')
fmt_dep = fmt.get_variable('fmt_header_only_dep')

Building the Documentation
==========================

Expand Down