From ecb067c11b1f5955db146474e8c2da74d1f718f4 Mon Sep 17 00:00:00 2001 From: Carson R Date: Mon, 16 Oct 2023 17:40:19 +0000 Subject: [PATCH] add meson instructions to usage docs --- doc/usage.rst | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/doc/usage.rst b/doc/usage.rst index f9f818584a9a..717fd1cdf9a7 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -134,6 +134,44 @@ For ``build2`` newcomers or to get more details and use cases, you can read the ``build2`` `toolchain introduction `_. +Usage with Meson +================ + +`Meson's WrapDB ` 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 ==========================