aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarson Riker <carson.riker@cosm.com>2023-10-18 14:53:47 -0400
committerGitHub <noreply@github.com>2023-10-18 11:53:47 -0700
commitbaae1ed65855796055d226571ac5ca376266914d (patch)
tree08805c98bfc50bf45fc411b88a92f15e25789c99
parent2ac6c5ca8b3dfbcb1cc5cf49a8cc121e3984559c (diff)
downloadfmtlib-baae1ed65855796055d226571ac5ca376266914d.tar.gz
add meson instructions to usage docs (#3677)
-rw-r--r--doc/usage.rst38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/usage.rst b/doc/usage.rst
index f9f81858..717fd1cd 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 <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
==========================