-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
58 lines (51 loc) · 1.62 KB
/
meson.build
File metadata and controls
58 lines (51 loc) · 1.62 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
# switch - alternatives management tool for NurOS
# Copyright (C) 2026 AnmiTaliDev <anmitali198@gmail.com>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# 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.
project('switch', 'c',
version: '1.0.0',
license: 'GPL-3.0-or-later',
default_options: [
'c_std=c11',
'warning_level=2',
'buildtype=release'
],
meson_version: '>= 0.60.0'
)
# Configuration
conf_data = configuration_data()
conf_data.set_quoted('SWITCH_VERSION', meson.project_version())
conf_data.set_quoted('SWITCH_MODULES_DIR', get_option('prefix') / get_option('datadir') / 'switch' / 'modules')
conf_data.set_quoted('SWITCH_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir') / 'switch')
configure_file(
output: 'config_generated.h',
configuration: conf_data
)
# Source files
src_files = files(
'src/main.c',
'src/module.c',
'src/config.c',
'src/utils.c'
)
# Build executable
switch_exe = executable('switch',
src_files,
include_directories: include_directories('src'),
install: true
)
# Install modules
install_subdir('modules',
install_dir: get_option('datadir') / 'switch',
install_mode: ['rwxr-xr-x', 'root', 'root']
)
# Summary
summary({
'prefix': get_option('prefix'),
'bindir': get_option('prefix') / get_option('bindir'),
'modules_dir': get_option('prefix') / get_option('datadir') / 'switch' / 'modules',
}, section: 'Directories')