-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmeson.build
More file actions
84 lines (74 loc) · 2.63 KB
/
meson.build
File metadata and controls
84 lines (74 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
project('epdfview', 'cpp',
version : '0.3.0',
default_options : ['warning_level=2', 'cpp_std=c++14', 'werror=false'],
meson_version : '>= 0.50.0',
license : 'GPL-2.0-or-later',
)
i18n = import('i18n')
# Build options
debug_build = get_option('buildtype') == 'debug'
if debug_build
add_project_arguments('-DDEBUG', language : 'cpp')
else
add_project_arguments('-DNDEBUG', '-DG_DISABLE_ASSERT', language : 'cpp')
endif
# Additional compiler flags
add_project_arguments([
'-Wno-long-long',
'-Wno-deprecated-declarations',
'-Wno-deprecated',
'-Wno-error=deprecated-declarations',
# GTK4 migration debugging flags - DISABLED for now as they may cause issues
'-DGDK_DISABLE_DEPRECATED',
'-DGTK_DISABLE_DEPRECATED',
'-DG_ENABLE_DIAGNOSTIC=1',
], language : 'cpp')
# Dependencies with version requirements
gtk_dep = dependency('gtk4', version : '>= 4.0.0')
poppler_dep = dependency('poppler-glib', version : '>= 0.5.0')
glib_dep = dependency('gthread-2.0', version : '>= 2.8.0')
pango_dep = dependency('pango')
# Check for CUPS
cups_dep = dependency('cups', required : get_option('cups'))
if cups_dep.found() and host_machine.system() != 'windows'
message('CUPS support: ENABLED')
add_project_arguments('-DHAVE_CUPS=1', language : 'cpp')
else
message('CUPS support: DISABLED')
endif
# Check for Poppler version
if poppler_dep.version().version_compare('>=0.5.2')
add_project_arguments('-DHAVE_POPPLER_0_5_2=1', language : 'cpp')
endif
if poppler_dep.version().version_compare('>=0.6.0')
add_project_arguments('-DHAVE_POPPLER_0_6_0=1', language : 'cpp')
endif
if poppler_dep.version().version_compare('>=0.8.0')
add_project_arguments('-DHAVE_POPPLER_0_8_0=1', language : 'cpp')
endif
if poppler_dep.version().version_compare('>=0.15.0')
add_project_arguments('-DHAVE_POPPLER_0_15_0=1', language : 'cpp')
endif
if poppler_dep.version().version_compare('>=0.15.1')
add_project_arguments('-DHAVE_POPPLER_0_15_1=1', language : 'cpp')
endif
if poppler_dep.version().version_compare('>=0.17.0')
add_project_arguments('-DHAVE_POPPLER_0_17_0=1', language : 'cpp')
endif
# Configuration
conf_data = configuration_data()
conf_data.set_quoted('PACKAGE', 'epdfview')
conf_data.set_quoted('VERSION', meson.project_version())
conf_data.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
conf_data.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
configure_file(output : 'config.h', configuration : conf_data)
# Include directories
inc = include_directories('src', '.')
# Subdirectories
subdir('src')
subdir('data')
subdir('po')
# Tests (optional)
if get_option('tests')
subdir('tests')
endif