-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmeson.build
More file actions
92 lines (70 loc) · 2.5 KB
/
Copy pathmeson.build
File metadata and controls
92 lines (70 loc) · 2.5 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
85
86
87
88
89
90
91
92
project(
'inscriptions',
['c', 'vala'],
license: 'GPL-3.0-or-later',
version: '1.1.3', # Versioning: first should follow Gtk version, second and third depending how proud you are of the update
meson_version: '>= 1.1' # Use meson.options instead of meson_options.txt
)
app_name = meson.project_name()
app_id = 'io.github.elly_code.' + app_name
app_path = '/io/github/elly_code/' + app_name
app_version = meson.project_version()
publisher = 'elly-code'
development = get_option('development')
if development
app_id += '.devel'
add_project_arguments('--define=DEVEL', language: 'vala')
endif
gnome = import('gnome')
i18n = import('i18n')
add_project_arguments(
'-DGETTEXT_PACKAGE="@0@"'.format (app_id), #
'-DG_LOG_DOMAIN="@0@"'.format (app_id), # Dev builds add the app_id to G_MESSAGES_DEBUG
'-w', # Because of Vala we get ten thousand warnings we can do nothing about
language:'c'
)
#================================
# OS and Ports related
linux = get_option('profile') == 'linux'
windows = get_option('profile') == 'windows'
# Here is to autodetect and adjust
# Remember however that people may do cross compiling, so do not assume by default it is for linux
# So avoid else conditions adding linux stuff
build_machine_system = build_machine.system()
if build_machine_system == 'windows'
windows = true
endif
# Here is to adjust the project accordingly to stuff
# Porting efforts: add your OS here
if windows
add_project_arguments('--define=WINDOWS', language: 'vala')
elif linux
add_project_arguments('--define=LINUX', language: 'vala')
endif
#================================
# Play nice with clang
# https://gitlab.gnome.org/GNOME/vala/-/issues/1413#note_1707480
if meson.get_compiler ('c').get_id () == 'clang'
add_project_arguments('-Wno-incompatible-function-pointer-types', language: 'c')
endif
#================================
# config_data is reused accross all project to propagate variables we set once
config_data = configuration_data()
config_data = configuration_data(
{
'APP_NAME': app_name,
'APP_ID': app_id,
'APP_PATH': app_path,
'APP_VERSION': app_version,
'PUBLISHER': publisher,
'LOCALEDIR': get_option('prefix') / get_option('localedir')
}
)
subdir('po')
subdir('data')
subdir ('src')
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true,
)