summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJonathan Schleifer <js@nil.im>2024-04-11 01:46:27 +0200
committerEli Schwartz <eschwartz93@gmail.com>2024-04-28 03:14:29 -0400
commit6c6529337e72812a64ff4a193d1888cc7822de58 (patch)
tree7672560e73f02b46d45b1d6569cf7bca3e33505e /docs
parent205f09e1b022a71a64eb48e22bb52f76e0da21ef (diff)
downloadmeson-6c6529337e72812a64ff4a193d1888cc7822de58.tar.gz
Add support for depending on ObjFW
This uses objfw-config to get to the flags, however, there's still several todos that can only be addressed once dependencies can have per-language flags.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Dependencies.md42
-rw-r--r--docs/markdown/snippets/objfw_dep.md24
2 files changed, 61 insertions, 5 deletions
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md
index 88e6575a7..d91582523 100644
--- a/docs/markdown/Dependencies.md
+++ b/docs/markdown/Dependencies.md
@@ -266,11 +266,12 @@ DC="dmd" meson setup builddir
## Config tool
-[CUPS](#cups), [LLVM](#llvm), [pcap](#pcap), [WxWidgets](#wxwidgets),
-[libwmf](#libwmf), [GCrypt](#libgcrypt), [GPGME](#gpgme), and GnuStep either do not provide pkg-config
-modules or additionally can be detected via a config tool
-(cups-config, llvm-config, libgcrypt-config, etc). Meson has native support for these
-tools, and they can be found like other dependencies:
+[CUPS](#cups), [LLVM](#llvm), [ObjFW](#objfw), [pcap](#pcap),
+[WxWidgets](#wxwidgets), [libwmf](#libwmf), [GCrypt](#libgcrypt),
+[GPGME](#gpgme), and GnuStep either do not provide pkg-config modules or
+additionally can be detected via a config tool (cups-config, llvm-config,
+libgcrypt-config, etc). Meson has native support for these tools, and they can
+be found like other dependencies:
```meson
pcap_dep = dependency('pcap', version : '>=1.0')
@@ -278,6 +279,7 @@ cups_dep = dependency('cups', version : '>=1.4')
llvm_dep = dependency('llvm', version : '>=4.0')
libgcrypt_dep = dependency('libgcrypt', version: '>= 1.8')
gpgme_dep = dependency('gpgme', version: '>= 1.0')
+objfw_dep = dependency('objfw', version: '>= 1.0')
```
*Since 0.55.0* Meson won't search $PATH any more for a config tool
@@ -637,6 +639,36 @@ language-specific, you must specify the requested language using the
Meson uses pkg-config to find NetCDF.
+## ObjFW
+
+*(added 1.5.0)*
+
+Meson has native support for ObjFW, including support for ObjFW packages.
+
+In order to use ObjFW, simply create the dependency:
+
+```meson
+objfw_dep = dependency('objfw')
+```
+
+In order to also use ObjFW packages, simply specify them as modules:
+
+```meson
+objfw_dep = dependency('objfw', modules: ['SomePackage'])
+```
+
+If you need a dependency with and without packages, e.g. because your tests
+want to use ObjFWTest, but you don't want to link your application against the
+tests, simply get two dependencies and use them as appropriate:
+
+```meson
+objfw_dep = dependency('objfw', modules: ['SomePackage'])
+objfwtest_dep = dependency('objfw', modules: ['ObjFWTest'])
+```
+
+Then use `objfw_dep` for your library and only `objfwtest_dep` (not both) for
+your tests.
+
## OpenMP
*(added 0.46.0)*
diff --git a/docs/markdown/snippets/objfw_dep.md b/docs/markdown/snippets/objfw_dep.md
new file mode 100644
index 000000000..e65da2885
--- /dev/null
+++ b/docs/markdown/snippets/objfw_dep.md
@@ -0,0 +1,24 @@
+## A new dependency for ObjFW is now supported
+
+For example, you can create a simple application written using ObjFW like this:
+
+```meson
+project('SimpleApp', 'objc')
+
+objfw_dep = dependency('objfw', version: '>= 1.0')
+
+executable('SimpleApp', 'SimpleApp.m',
+ dependencies: [objfw_dep])
+```
+
+Modules are also supported. A test case using ObjFWTest can be created like
+this:
+
+```meson
+project('Tests', 'objc')
+
+objfwtest_dep = dependency('objfw', version: '>= 1.1', modules: ['ObjFWTest'])
+
+executable('Tests', ['FooTest.m', 'BarTest.m'],
+ dependencies: [objfwtest_dep])
+```