-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
97 lines (86 loc) · 2.9 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
# Copyright (C) 2025 Miro Palmu.
#
# This file 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 file 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 file. If not, see <https://www.gnu.org/licenses/>.
project(
'guilander',
'cpp',
version: '0.0.1',
meson_version: '>= 1.4.0',
default_options : [
'warning_level=3',
'cpp_std=c++26',
],
)
if not meson.is_subproject()
add_global_arguments('-fconcepts-diagnostics-depth=10', language : 'cpp')
endif
waylander_proj = subproject('waylander')
waylander_dep = waylander_proj.get_variable('waylander_dep')
guilander_source_files = []
# Subdirectors
subdir('docs')
subdir('src')
cpp = meson.get_compiler('cpp')
guilander_lib = static_library(
'guilander',
guilander_source_files,
include_directories : include_directories('include'),
dependencies : [
waylander_dep,
dependency('freetype2'),
dependency('mdspan'),
dependency('mp-units'),
dependency('fontconfig'),
cpp.find_library('unistring'),
],
)
guilander_dep = declare_dependency(
include_directories : include_directories('include'),
link_with : guilander_lib,
dependencies : [
waylander_dep,
dependency('mp-units'),
dependency('mdspan'),
dependency('freetype2'),
],
)
if not meson.is_subproject()
# Tests has to come after guiladner_lib as they use it as meson dependency.
subdir('tests')
subdir('examples')
# compile_commands.json stuff:
compdb = find_program('compdb', required : false)
if compdb.found() and meson.backend() == 'ninja'
message('Custom target compdb added for generating compile_commands.json entries for headers')
custom_target(
'compdb',
output: 'compdb',
command: [
files('.generate_compile_commands_json_with_headers.sh'),
meson.project_build_root(),
meson.project_source_root(),
],
install: false,
build_always_stale: true,
)
else
message('Skipping custom target compdb for greating compile_commands.json entries for headers due to:')
if not compdb.found()
message('- missing compdb (compdb can be installed with: pip install compdb)')
endif
if meson.backend() != 'ninja'
message('- ninja is not meson backend (only backend that generates compile_commands.json)')
endif
endif
endif