-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
80 lines (65 loc) · 2.33 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
# Copyright 2021 Clayton Craft
#
# This file is part of lvglcharger, hereafter referred to as the program.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
project(
'lvglcharger',
'c',
version: '0.1.0',
default_options: 'warning_level=3',
meson_version: '>=0.53.0'
)
add_project_arguments('-DUL_VERSION="@0@"'.format(meson.project_version()), language: ['c'])
enable_static = (get_option('default_library') == 'static')
lvglcharger_sources = [
'backends.c',
'command_line.c',
'config.c',
'log.c',
'main.c',
'terminal.c',
'themes.c',
'theme.c'
]
lvglcharger_dependencies = [
dependency('inih', static: enable_static),
]
cc = meson.get_compiler('c')
libdrm_dep = dependency('libdrm', required: get_option('with-drm'), static: enable_static)
if libdrm_dep.found()
lvglcharger_dependencies += [libdrm_dep]
add_project_arguments('-DUSE_DRM=1', language: ['c'])
endif
minui_dep = dependency('minui', required: get_option('with-minui'), static: enable_static)
if minui_dep.found()
lvglcharger_dependencies += [
minui_dep,
cc.find_library('m', required : false, static: enable_static)
]
add_project_arguments('-DUSE_MINUI=1', language: ['c'])
if get_option('minui-bgra')
add_project_arguments('-DMINUI_IS_BGRA=1', language: ['c'])
endif
endif
lvgl_sources = run_command('find-lvgl-sources.sh', 'lvgl', check: true).stdout().strip().split('\n')
lv_drivers_sources = run_command('find-lvgl-sources.sh', 'lv_drivers', check: true).stdout().strip().split('\n')
install_data(sources: 'lvglcharger.conf', install_dir : get_option('sysconfdir'))
executable(
'lvglcharger',
sources: lvglcharger_sources + lvgl_sources + lv_drivers_sources,
include_directories: ['lvgl', 'lv_drivers'],
dependencies: lvglcharger_dependencies,
install: true
)