2018-09-19 20:59:19 +00:00
|
|
|
project(
|
|
|
|
'gedit', 'c',
|
2024-06-18 16:03:53 +00:00
|
|
|
version: '48.alpha',
|
2023-07-25 14:00:00 +00:00
|
|
|
meson_version: '>= 0.59',
|
|
|
|
default_options: ['warning_level=2']
|
2018-09-19 20:59:19 +00:00
|
|
|
)
|
|
|
|
|
2019-12-05 16:31:17 +00:00
|
|
|
if host_machine.system() == 'darwin'
|
|
|
|
add_languages('objc')
|
|
|
|
endif
|
|
|
|
|
2018-09-19 20:59:19 +00:00
|
|
|
gnome = import('gnome')
|
|
|
|
i18n = import('i18n')
|
2020-05-08 19:53:03 +00:00
|
|
|
pkg_config = import('pkgconfig')
|
2018-09-19 20:59:19 +00:00
|
|
|
python = import('python')
|
2023-07-25 14:00:00 +00:00
|
|
|
fs = import('fs')
|
2018-09-19 20:59:19 +00:00
|
|
|
|
2024-06-18 16:03:53 +00:00
|
|
|
api_version = '48'
|
2018-09-19 20:59:19 +00:00
|
|
|
|
2023-07-25 14:00:00 +00:00
|
|
|
#####
|
|
|
|
# CFLAGS
|
|
|
|
# Some flags are missing when using only the builtin warning_level meson option,
|
|
|
|
# even at the maximum level.
|
|
|
|
# The following warning_cflags suppose that warning_level=2.
|
|
|
|
|
|
|
|
# Tries to mimic the AX_COMPILER_FLAGS Autotools macro.
|
|
|
|
warning_cflags = [
|
|
|
|
'-fno-strict-aliasing',
|
|
|
|
'-Wundef',
|
|
|
|
'-Wnested-externs',
|
|
|
|
'-Wwrite-strings',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
'-Wmissing-prototypes',
|
|
|
|
'-Wstrict-prototypes',
|
|
|
|
'-Wredundant-decls',
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
'-Wdeclaration-after-statement',
|
|
|
|
'-Wformat=2',
|
|
|
|
'-Wold-style-definition',
|
|
|
|
'-Wcast-align',
|
|
|
|
'-Wformat-nonliteral',
|
|
|
|
'-Wformat-security',
|
2023-07-25 14:00:00 +00:00
|
|
|
|
|
|
|
#'-Wsign-compare',
|
|
|
|
'-Wno-sign-compare',
|
|
|
|
|
2023-07-25 14:00:00 +00:00
|
|
|
'-Wstrict-aliasing',
|
2023-10-24 14:00:00 +00:00
|
|
|
'-Wshadow',
|
2023-07-25 14:00:00 +00:00
|
|
|
'-Winline',
|
|
|
|
'-Wpacked',
|
|
|
|
'-Wmissing-format-attribute',
|
|
|
|
'-Wmissing-noreturn',
|
|
|
|
'-Winit-self',
|
|
|
|
'-Wredundant-decls',
|
|
|
|
'-Wmissing-include-dirs',
|
|
|
|
'-Wunused-but-set-variable',
|
|
|
|
'-Warray-bounds',
|
|
|
|
'-Wimplicit-function-declaration',
|
|
|
|
'-Wreturn-type',
|
2023-07-25 14:00:00 +00:00
|
|
|
#'-Wswitch-enum',
|
|
|
|
#'-Wswitch-default',
|
2023-07-25 14:00:00 +00:00
|
|
|
'-Wduplicated-cond',
|
|
|
|
'-Wduplicated-branches',
|
|
|
|
'-Wlogical-op',
|
|
|
|
'-Wrestrict',
|
|
|
|
'-Wnull-dereference',
|
|
|
|
'-Wjump-misses-init',
|
|
|
|
'-Wdouble-promotion',
|
|
|
|
]
|
|
|
|
|
|
|
|
c_compiler = meson.get_compiler('c')
|
|
|
|
supported_warning_cflags = c_compiler.get_supported_arguments(warning_cflags)
|
|
|
|
# Use add_global_arguments() (not add_project_arguments()) so that it is applied
|
|
|
|
# to libgd as well.
|
|
|
|
add_global_arguments(supported_warning_cflags, language: 'c')
|
|
|
|
##### end CFLAGS
|
|
|
|
|
2018-09-19 20:59:19 +00:00
|
|
|
# Paths
|
2019-12-04 13:17:44 +00:00
|
|
|
root_include_dir = include_directories('.')
|
2018-09-19 20:59:19 +00:00
|
|
|
|
|
|
|
srcdir = meson.current_source_dir()
|
|
|
|
|
2020-05-08 18:01:23 +00:00
|
|
|
pkglibdir = get_option('prefix') / get_option('libdir') / 'gedit'
|
|
|
|
pkgdatadir = get_option('prefix') / get_option('datadir') / 'gedit'
|
|
|
|
glibdir = get_option('prefix') / get_option('datadir') / 'glib-2.0'
|
2018-09-19 20:59:19 +00:00
|
|
|
|
|
|
|
# Subprojects
|
2023-07-25 14:00:00 +00:00
|
|
|
if fs.is_dir('.git')
|
2023-03-21 15:00:00 +00:00
|
|
|
run_command(
|
|
|
|
'git', '-C', meson.project_source_root(), 'submodule', 'update', '--init', '--recursive',
|
|
|
|
check: true,
|
|
|
|
)
|
2019-01-13 01:55:00 +00:00
|
|
|
endif
|
|
|
|
|
2019-12-04 13:44:21 +00:00
|
|
|
libgd_subproject = subproject(
|
2018-09-19 20:59:19 +00:00
|
|
|
'libgd',
|
|
|
|
default_options: [
|
|
|
|
'with-tagged-entry=true',
|
|
|
|
'static=true',
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2020-03-14 13:37:42 +00:00
|
|
|
libgd_dep = libgd_subproject.get_variable('libgd_dep')
|
|
|
|
|
2018-09-19 20:59:19 +00:00
|
|
|
# Dependencies
|
2024-03-13 13:21:55 +00:00
|
|
|
gio_dep = dependency('gio-2.0', version: '>= 2.76')
|
2020-05-08 19:53:03 +00:00
|
|
|
|
|
|
|
libgedit_public_deps = [
|
2020-05-07 03:09:51 +00:00
|
|
|
gio_dep,
|
2022-07-15 08:49:56 +00:00
|
|
|
dependency('gtk+-3.0', version: '>= 3.22'),
|
2023-07-18 14:00:00 +00:00
|
|
|
dependency('libgedit-amtk-5'),
|
2024-04-25 19:43:43 +00:00
|
|
|
dependency('libgedit-tepl-6'),
|
2022-07-15 08:49:56 +00:00
|
|
|
dependency('libpeas-gtk-1.0'),
|
2020-05-08 19:53:03 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
deps_basic_list = [
|
|
|
|
libgedit_public_deps,
|
2020-05-07 03:36:06 +00:00
|
|
|
dependency('gobject-introspection-1.0'),
|
2020-05-07 03:09:51 +00:00
|
|
|
]
|
|
|
|
|
2022-07-15 08:49:56 +00:00
|
|
|
gspell_dep = dependency('gspell-1', version: '>= 1.0')
|
|
|
|
python3 = python.find_installation('python3')
|
|
|
|
|
2018-09-19 20:59:19 +00:00
|
|
|
# Configurations
|
|
|
|
config_h = configuration_data()
|
2020-04-30 20:05:53 +00:00
|
|
|
config_h.set_quoted('PACKAGE_STRING', 'gedit-@0@'.format(api_version))
|
2019-12-04 12:07:57 +00:00
|
|
|
config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
2019-12-05 14:28:48 +00:00
|
|
|
config_h.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
|
|
|
|
config_h.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
|
2019-12-04 10:21:16 +00:00
|
|
|
config_h.set_quoted('VERSION', meson.project_version())
|
2023-07-25 14:00:00 +00:00
|
|
|
config_h.set10('OS_MACOS', host_machine.system() == 'darwin')
|
2023-07-25 14:00:00 +00:00
|
|
|
|
|
|
|
if get_option('headerbar') == 'auto'
|
|
|
|
config_h.set10('GEDIT_HAS_HEADERBAR', host_machine.system() != 'darwin')
|
|
|
|
else
|
|
|
|
config_h.set10('GEDIT_HAS_HEADERBAR', get_option('headerbar') == 'yes')
|
|
|
|
endif
|
2019-12-04 10:10:07 +00:00
|
|
|
|
2018-09-19 20:59:19 +00:00
|
|
|
configure_file(
|
|
|
|
output: 'config.h',
|
|
|
|
configuration: config_h
|
|
|
|
)
|
|
|
|
|
|
|
|
subdir('data')
|
|
|
|
subdir('po')
|
|
|
|
subdir('gedit')
|
2019-12-06 06:53:55 +00:00
|
|
|
subdir('plugins')
|
2018-09-19 20:59:19 +00:00
|
|
|
|
2019-12-05 11:52:31 +00:00
|
|
|
if get_option('gtk_doc')
|
|
|
|
subdir('docs/reference')
|
|
|
|
endif
|
2019-11-12 12:25:54 +00:00
|
|
|
|
2019-11-19 14:26:31 +00:00
|
|
|
if get_option('user_documentation')
|
2019-11-12 12:25:54 +00:00
|
|
|
subdir('help')
|
|
|
|
endif
|
2018-09-19 20:59:19 +00:00
|
|
|
|
2019-12-04 15:47:41 +00:00
|
|
|
meson.add_install_script(
|
|
|
|
'build-aux/meson/post_install.py',
|
2020-03-16 12:50:41 +00:00
|
|
|
get_option('prefix') / get_option('libdir'),
|
2022-10-08 00:55:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
gnome.post_install(
|
|
|
|
glib_compile_schemas: true,
|
|
|
|
gtk_update_icon_cache: true,
|
|
|
|
update_desktop_database: true,
|
2019-12-04 15:47:41 +00:00
|
|
|
)
|
|
|
|
|
2020-03-23 11:21:02 +00:00
|
|
|
summary('API version', api_version)
|
|
|
|
summary('Prefix', get_option('prefix'))
|
|
|
|
summary('API documentation', get_option('gtk_doc'))
|
|
|
|
summary('User documentation', get_option('user_documentation'))
|
|
|
|
summary('Require all tests', get_option('require_all_tests'))
|
2023-07-25 14:00:00 +00:00
|
|
|
summary('Headerbar', get_option('headerbar'))
|