summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@gnome.org>2023-12-04 14:08:50 +0000
committerPhilip Withnall <pwithnall@gnome.org>2023-12-04 14:08:50 +0000
commit00077eb7e35e292f56b5ead35327379424dfd311 (patch)
tree0832d047d0b2ffb4cfa05122bc55278aad2bf307
parent9ce3ed6bf9f2c95db12ed3b67bd5fb1f925aca17 (diff)
build: Export xdgmime as a dependency
This allows xdgmime.git to be used as a meson subproject in other projects, which should simplify embedding it. It requires a bump to the Meson version to support `meson.override_dependency()`, but 0.54.0 is still quite an old release now, so that shouldn’t cause problems. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
-rw-r--r--meson.build2
-rw-r--r--src/meson.build17
2 files changed, 14 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index f0fa77c..215415b 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
project('xdgmime', 'c',
version: '0.0',
default_options: ['c_std=c99', 'warning_level=3', 'debug=true'],
- meson_version: '>=0.48.0',
+ meson_version: '>=0.54.0',
)
add_project_arguments(
diff --git a/src/meson.build b/src/meson.build
index ceb407c..1d4da89 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,4 @@
-libcommon = static_library('common',
+xdgmime_sources = [
'xdgmime.c',
'xdgmimeglob.c',
'xdgmimeint.c',
@@ -7,12 +7,21 @@ libcommon = static_library('common',
'xdgmimeparent.c',
'xdgmimecache.c',
'xdgmimeicon.c',
+]
+
+libxdgmime = static_library('xdgmime',
+ sources: xdgmime_sources,
native: true,
)
+libxdgmime_dep = declare_dependency(
+ link_with : libxdgmime,
+)
+meson.override_dependency('xdgmime', libxdgmime_dep)
+
test_mime = executable('test-mime',
'test-mime.c',
- link_with: libcommon,
+ link_with: libxdgmime,
native: true,
install: false,
)
@@ -20,7 +29,7 @@ meson.override_find_program('test-mime', test_mime)
test_mime_data = executable('test-mime-data',
'test-mime-data.c',
- link_with: libcommon,
+ link_with: libxdgmime,
native: true,
install: false,
)
@@ -28,7 +37,7 @@ meson.override_find_program('test-mime-data', test_mime_data)
print_mime_data = executable('print-mime-data',
'print-mime-data.c',
- link_with: libcommon,
+ link_with: libxdgmime,
native: true,
install: false,
)