# SPDX-FileCopyrightText: 2016-2024 Bruce Cowan <bruce@bcowan.me.uk>
#
# SPDX-License-Identifier: GPL-3.0-or-later

project('rugby', 'c',
  version: '0.4.alpha',
  license:'GPLv3+',
  meson_version: '>= 1.1.0',
  default_options: [
    'buildtype=debugoptimized',
    'c_std=gnu11',
    'warning_level=3'
  ],
)

datadir = get_option('datadir')
desktopdir = datadir / 'applications'

gnome = import('gnome')

gio_dep = dependency('gio-2.0', version: '>= 2.76')
gtk_dep = dependency('gtk4', version: '>= 4.12')
libadwaita_dep = dependency('libadwaita-1', version: '>=1.5.beta')

conf = configuration_data()

profile = get_option('profile')
conf.set_quoted('PROFILE', profile)

if profile == 'development'
  conf.set_quoted('VERSION', '@0@-@VCS_TAG@'.format(meson.project_version()))
else
  conf.set_quoted('VERSION', meson.project_version())
endif

cflags = ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_70',
          '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_70',
          '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_12',
          '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_12',
          '-Wno-overlength-strings',
]

cc = meson.get_compiler('c')

add_project_arguments(cc.get_supported_arguments(cflags),
                      language: 'c')

subdir('data')
subdir('src')

gnome.post_install(
  glib_compile_schemas: true,
  update_desktop_database: true,
)