-
Notifications
You must be signed in to change notification settings - Fork 21
/
meson.build
160 lines (137 loc) · 5.23 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
project('gBar',
['c', 'cpp'],
version: '0.0.1',
license: 'MIT',
meson_version: '>=0.53.0',
default_options: ['cpp_std=c++17',
'warning_level=3',
'default_library=static',
'buildtype=release'],
)
# Wayland protocols
wayland_client = dependency('wayland-client')
wayland_scanner = find_program('wayland-scanner')
ext_workspace_src = custom_target('generate-ext-workspace-src',
input: ['protocols/ext-workspace-unstable-v1.xml'],
output: ['ext-workspace-unstable-v1.c'],
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'])
ext_workspace_header = custom_target('generate-ext-workspace-header',
input: ['protocols/ext-workspace-unstable-v1.xml'],
output: ['ext-workspace-unstable-v1.h'],
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
wlr_foreign_toplevel_src = custom_target('generate-wlr-foreign-toplevel-src',
input: ['protocols/wlr-foreign-toplevel-management-unstable-v1.xml'],
output: ['wlr-foreign-toplevel-management-unstable-v1.c'],
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'])
wlr_foreign_toplevel_header = custom_target('generate-wlr-foreign-toplevel-header',
input: ['protocols/wlr-foreign-toplevel-management-unstable-v1.xml'],
output: ['wlr-foreign-toplevel-management-unstable-v1.h'],
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
gtk = dependency('gtk+-3.0')
gtk_layer_shell = dependency('gtk-layer-shell-0')
pulse = dependency('libpulse')
headers = [
'src/Common.h',
'src/Log.h',
'src/System.h',
'src/PulseAudio.h',
'src/Widget.h',
'src/Window.h',
'src/Wayland.h',
'src/Config.h',
'src/CSS.h'
]
sources = [
ext_workspace_src,
ext_workspace_header,
wlr_foreign_toplevel_src,
wlr_foreign_toplevel_header,
'src/Window.cpp',
'src/Widget.cpp',
'src/Wayland.cpp',
'src/System.cpp',
'src/Bar.cpp',
'src/Workspaces.cpp',
'src/AudioFlyin.cpp',
'src/BluetoothDevices.cpp',
'src/Plugin.cpp',
'src/Config.cpp',
'src/CSS.cpp',
'src/Log.cpp',
'src/SNI.cpp',
]
dependencies = [gtk, gtk_layer_shell, pulse, wayland_client]
if get_option('WithHyprland')
add_global_arguments('-DWITH_HYPRLAND', language: 'cpp')
headers += 'src/Workspaces.h'
endif
if get_option('WithWorkspaces')
add_global_arguments('-DWITH_WORKSPACES', language: 'cpp')
headers += 'src/Workspaces.h'
endif
if get_option('WithLibSass')
add_global_arguments('-DWITH_LIBSASS', language: 'cpp')
dependencies += dependency('libsass')
endif
if get_option('WithNvidia')
add_global_arguments('-DWITH_NVIDIA', language: 'cpp')
headers += 'src/NvidiaGPU.h'
endif
if get_option('WithAMD')
add_global_arguments('-DWITH_AMD', language: 'cpp')
headers += 'src/AMDGPU.h'
endif
if get_option('WithBlueZ')
add_global_arguments('-DWITH_BLUEZ', language: 'cpp')
endif
if get_option('WithSNI')
add_global_arguments('-DWITH_SNI', language: 'cpp')
# DBus protocols
dbus_gen = find_program('gdbus-codegen')
sni_item_src = custom_target('generate-sni-item-src',
input: ['protocols/sni-item.xml'],
output: ['sni-item.c'],
command: [dbus_gen, '--c-namespace', 'sni', '--body', '--output', '@OUTPUT@', '@INPUT@'])
sni_item_header = custom_target('generate-sni-item-header',
input: ['protocols/sni-item.xml'],
output: ['sni-item.h'],
command: [dbus_gen, '--c-namespace', 'sni', '--header', '--output', '@OUTPUT@', '@INPUT@'])
sni_watcher_src = custom_target('generate-sni-watcher-src',
input: ['protocols/sni-watcher.xml'],
output: ['sni-watcher.c'],
command: [dbus_gen, '--c-namespace', 'sni', '--body', '--output', '@OUTPUT@', '@INPUT@'])
sni_watcher_header = custom_target('generate-sni-watcher-header',
input: ['protocols/sni-watcher.xml'],
output: ['sni-watcher.h'],
command: [dbus_gen, '--c-namespace', 'sni', '--header', '--output', '@OUTPUT@', '@INPUT@'])
libdbusmenu = dependency('dbusmenu-gtk3-0.4')
sources += sni_item_src
sources += sni_item_header
sources += sni_watcher_src
sources += sni_watcher_header
dependencies += libdbusmenu
endif
add_global_arguments('-DUSE_LOGFILE', language: 'cpp')
libgBar = library('gBar',
sources,
dependencies: dependencies,
install: true)
pkg = import('pkgconfig')
pkg.generate(libgBar)
executable(
'gBar',
['src/gBar.cpp'],
dependencies: [gtk],
link_with: libgBar,
install_rpath: '$ORIGIN/',
install: true
)
install_headers(
headers,
subdir: 'gBar'
)
install_data(
['css/style.css',
'css/style.scss'],
install_dir: get_option('datadir') / 'gBar'
)