summaryrefslogtreecommitdiff
path: root/libmenu/meson.build
diff options
context:
space:
mode:
authorXiaotian Wu <[email protected]>2023-01-08 11:51:53 +0800
committerraveit65 <[email protected]>2023-09-02 17:12:19 +0200
commitd5e498eacbd3ec8c144e302d3ee0309d437d6e5f (patch)
tree28bfd57eaac5375b12af29a53f8007011e2fe5a7 /libmenu/meson.build
parent5e3658eb0b2428a49b47d56300fec73f74f70f4f (diff)
downloadmate-menus-d5e498eacbd3ec8c144e302d3ee0309d437d6e5f.tar.bz2
mate-menus-d5e498eacbd3ec8c144e302d3ee0309d437d6e5f.tar.xz
add meson build system
After switching to meson, calling the `g-ir-scanner` command with the `--warn-all` parameter in the generated `build.ninja` file will display these warnings: ``` Warning: MateMenu: symbol="DesktopEntryType": unknown namespace for identifier "DesktopEntryType" Warning: MateMenu: symbol='desktop_entry_new': Unknown namespace for symbol 'desktop_entry_new' Warning: MateMenu: symbol='EntryDirectory': Unknown namespace for identifier 'EntryDirectory' ``` The reason for these warnings is that we use `MateMenu` as `identifier_prefix` and `matemenu` as `symbol_prefix`, but the symbols that report warnings do not start with these prefixes.
Diffstat (limited to 'libmenu/meson.build')
-rw-r--r--libmenu/meson.build72
1 files changed, 72 insertions, 0 deletions
diff --git a/libmenu/meson.build b/libmenu/meson.build
new file mode 100644
index 0000000..5fbc93e
--- /dev/null
+++ b/libmenu/meson.build
@@ -0,0 +1,72 @@
+source_h = [
+ 'matemenu-tree.h',
+]
+
+install_headers(source_h, subdir : 'mate-menus')
+
+sources = [
+ 'desktop-entries.h',
+ 'entry-directories.h',
+ 'menu-layout.h',
+ 'menu-monitor.h',
+ 'menu-util.h',
+ 'desktop-entries.c',
+ 'entry-directories.c',
+ 'matemenu-tree.c',
+ 'menu-layout.c',
+ 'menu-monitor.c',
+ 'menu-util.c',
+]
+
+gnome = import('gnome')
+pkg = import('pkgconfig')
+
+libmate_menu = shared_library('mate-menu',
+ sources,
+ dependencies: [gio_unix_dep],
+ soversion: soversion,
+ version: libversion,
+ include_directories: top_srcdir,
+ install : true,
+ install_dir : get_option('libdir')
+ )
+
+libmate_menu_deps = declare_dependency(sources: source_h,
+ include_directories: [top_srcdir, include_directories('.')],
+ dependencies: [gio_unix_dep],
+ link_with: libmate_menu)
+
+pkg.generate(
+ name: 'mate-menu',
+ version: meson.project_version(),
+ description: 'Desktop Menu Specification Implementation',
+ requires_private: 'gio-unix-2.0',
+ filebase: 'libmate-menu',
+ libraries: '-lmate-menu',
+ subdirs: 'mate-menus',
+ )
+
+if get_option('introspection')
+ libmate_menu_gir = gnome.generate_gir(libmate_menu,
+ sources: [source_h, sources],
+ nsversion : api_version,
+ namespace : 'MateMenu',
+ symbol_prefix : 'matemenu',
+ export_packages: 'libmatemenu',
+ identifier_prefix : 'MateMenu',
+ link_with: libmate_menu,
+ includes : ['Gio-2.0'],
+ install : true,
+ install_dir_gir: girdir,
+ install_dir_typelib: typelibdir,
+ extra_args: [ '--c-include=mate-menus/matemenu-tree.h' ],
+ )
+ if get_option('vapi')
+ mate_menu_vapi = gnome.generate_vapi('libmate-menu',
+ sources: libmate_menu_gir.get(0),
+ packages: 'gio-unix-2.0',
+ install: true,
+ install_dir: vapidir,
+ )
+ endif
+endif