-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmeson.build
99 lines (85 loc) · 2.4 KB
/
meson.build
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
93
94
95
96
97
98
99
project('nwg-launchers', 'cpp',
default_options: [
'cpp_std=c++17',
'warning_level=3'
],
license: 'GPL-3.0-or-later',
version: '0.7.1.1'
)
compiler = meson.get_compiler('cpp')
if compiler.has_link_argument('-lc++fs')
add_global_link_arguments('-lc++fs', language: 'cpp')
elif compiler.has_link_argument('-lstdc++fs')
add_global_link_arguments('-lstdc++fs', language: 'cpp')
endif
# Dependencies
gdk_x11 = dependency('gdk-x11-3.0', required: get_option('gdk-x11'))
## gtkmm
gtkmm = dependency('gtkmm-3.0', required: true)
## gtk-layer-shell
gtk_layer_shell = dependency(
'gtk-layer-shell-0',
version: ['>= 0.5.0'],
fallback: ['gtk-layer-shell-0', 'gtk-layer-shell'],
required: get_option('layer-shell')
)
if gtk_layer_shell.found()
add_project_arguments('-DHAVE_GTK_LAYER_SHELL', language: 'cpp')
endif
## nlohmann-json
json = dependency(
'nlohmann_json',
fallback: ['nlohmann_json', 'nlohmann_json_dep'],
required: true
)
# Generate configuration header
conf_data = configuration_data()
conf_data.set('version', meson.project_version())
conf_data.set('prefix', get_option('prefix'))
conf_data.set('datadir', get_option('prefix') / get_option('datadir') / 'nwg-launchers')
conf_data.set('HAVE_MODERN_NLOHMANN_JSON', json.version().version_compare('>=3.11.0'))
configure_file(
input : 'nwgconfig.h.in',
output : 'nwgconfig.h',
configuration : conf_data
)
# Include nwgconfig.h
nwg_conf_inc = include_directories('.')
subdir('common')
if get_option('bar')
subdir('bar')
endif
if get_option('dmenu')
subdir('dmenu')
endif
if get_option('grid')
subdir('grid')
endif
if get_option('generate-readme')
python = find_program('python3', required: false)
if not python.found()
message('python3 not found in PATH, trying python...')
python = find_program('python', required: true)
endif
# generate README.md from template
# make sure to copy it to the source directory!
readme = custom_target('readme',
output: [ 'README.md' ],
input: [ 'README.md.in' ],
command: [
python, '@SOURCE_ROOT@/make_readme.py',
'@INPUT@', '@OUTPUT@',
bar_exe.full_path(),
dmenu_exe.full_path(),
grid_client_exe.full_path(),
grid_server_exe.full_path()
],
depends: [bar_exe, dmenu_exe, grid_client_exe, grid_server_exe],
install_dir: conf_data.get('datadir'),
install: true
)
endif
install_data(
['icon-missing.svg', 'icon-missing.png'],
install_dir: conf_data.get('datadir')
)