project( YOUR_PROJECT_NAME_HERE_QUOTED, 'c', version: PUT YOUR INITIAL VERSION NUMBER HERE, QUOTED, WITH '-dev' APPENDED TO IT, license: 'GPL-2', meson_version: '>= 0.54.0', default_options: [ 'c_std=gnu11', 'buildtype=debugoptimized', 'warning_level=2', 'b_ndebug=if-release', ] ) project_namespace = YOUR_RPOJECT_NAMESPACE_HERE_QUOTED # like 'xfce' or 'apps' pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name() cc = meson.get_compiler('c') pkgconfig = import('pkgconfig') gnome = import('gnome') i18n = import('i18n') dependency_versions = { 'gir': '>= 1.72.0', 'glib': '>= 2.72.0', 'gtk': '>= 3.24.0', 'libx11': '>= 1.6.7', 'xfce4': '>= 4.18.0', } glib = dependency('glib-2.0', version: dependency_versions['glib']) gtk = dependency('gtk+-3.0', version: dependency_versions['gtk']) libx11 = dependency('x11', version: dependency_versions['libx11']) libxfce4util = dependency('libxfce4util-1.0', version: dependency_versions['xfce4']) libxfce4ui = dependency('libxfce4ui-2', version: dependency_versions['xfce4']) xfconf = dependency('libxfconf-0', version: dependency_versions['xfce4']) libxfce4panel = dependency('libxfce4panel-2.0', version: dependency_versions['xfce4']) garcon = dependency('garcon-1', version: dependency_versions['xfce4']) garcon_gtk3 = dependency('garcon-gtk3-1', version: dependency_versions['xfce4']) exo = dependency('exo-2', version: dependency_versions['xfce4']) # Uncomment if you use gobject-introspection (and uncomment the corresponding # option in meson_options.txt). #gir = dependency('gobject-introspection-1.0', version: dependency_versions['gir'], required: get_option('introspection')) # Uncomment if you are generating Vala API bindings #vapigen = find_program('vapigen', required: get_option('vala')) #if get_option('vala').enabled() # assert(get_option('introspection'), 'Building Vala bindings requires building GObject introspection data') #endif #generate_vala = not get_option('vala').disabled() and vapigen.found() extra_cflags = [] extra_cflags_check = [ '-Wmissing-declarations', '-Wmissing-noreturn', '-Wold-style-definition', '-Wredundant-decls', '-Wpointer-arith', '-Wcast-align', '-Winit-self', '-Wshadow', '-Wmissing-include-dirs', '-Wundef', '-Wformat', '-Wformat-security', '-Wformat-y2k', '-Wnested-externs', '-Wno-unused-parameter', '-Wno-declaration-after-statement', '-Werror=implicit-function-declaration', '-Wno-error=deprecated-declarations', ] buildtype = get_option('buildtype') if buildtype == 'debug' or buildtype == 'debugoptimized' extra_cflags_check += '-fstack-protector-strong' extra_cflags += '-DDEBUG=1' if buildtype == 'debug' extra_cflags += [ '-DG_ENABLE_DEBUG', '-DDEBUG_TRACE=1', ] endif elif buildtype == 'minsize' extra_cflags += [ '-DNDEBUG', '-DG_DISABLE_CAST_CHECKS', '-DG_DISABLE_ASSERT', ] endif if dependency_versions.has_key('glib') glib_version_parts = dependency_versions['glib'].split(' ') glib_min_version_parts = glib_version_parts[1].split('.') glib_min_version_define = 'GLIB_VERSION_@0@_@1@'.format(glib_min_version_parts[0], glib_min_version_parts[1]) extra_cflags += [ '-DGLIB_VERSION_MIN_REQUIRED=@0@'.format(glib_min_version_define), '-DGLIB_VERSION_MAX_ALLOWED=@0@'.format(glib_min_version_define), '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name()), '-DG_LOG_USE_STRUCTURED=1', ] endif version_parts = meson.project_version().split('-dev')[0].split('.') version_short = '@0@.@1@'.format(version_parts[0], version_parts[1]) extra_cflags += [ '-DPACKAGE="@0@"'.format(meson.project_name()), '-DPACKAGE_NAME="@0@"'.format(meson.project_name()), '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()), '-DVERSION="@0@"'.format(meson.project_version()), '-DVERSION_SHORT="@0@"'.format(version_short), '-DPACKAGE_STRING="@0@ @1@"'.format(meson.project_name(), meson.project_version()), '-DPACKAGE_DATADIR="@0@"'.format(pkgdatadir), '-DPACKAGE_LOCALE_DIR="@0@"'.format(get_option('prefix') / get_option('localedir')), '-DPACKAGE_BUGREPORT="https://gitlab.xfce.org/@0@/@1@/-/issues"'.format(project_namespace, meson.project_name()), '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), '-DPREFIX="@0@"'.format(get_option('prefix')), '-DBINDIR="@0@"'.format(get_option('prefix') / get_option('bindir')), '-DDATADIR="@0@"'.format(get_option('prefix') / get_option('datadir')), '-DINCLUDEDIR="@0@"'.format(get_option('prefix') / get_option('includedir')), '-DLIBDIR="@0@"'.format(get_option('prefix') / get_option('libdir')), '-DLIBEXECDIR="@0@"'.format(get_option('prefix') / get_option('libexecdir')), '-DLOCALEDIR="@0@"'.format(get_option('prefix') / get_option('localedir')), '-DLOCALSTATEDIR="@0@"'.format(get_option('prefix') / get_option('localstatedir')), '-DSBINDIR="@0@"'.format(get_option('prefix') / get_option('sbindir')), '-DSYSCONFDIR="@0@"'.format(get_option('prefix') / get_option('sysconfdir')), '-DHAVE_XFCE_REVISION_H=1', ] add_project_arguments(cc.get_supported_arguments(extra_cflags_check), language: 'c') add_project_arguments(extra_cflags, language: 'c') xfce_revision_h = vcs_tag( command: ['git', 'rev-parse', '--short', 'HEAD'], fallback: 'UNKNOWN', input: 'xfce-revision.h.in', output: 'xfce-revision.h', replace_string: '@REVISION@', )