-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
59 lines (49 loc) · 1.55 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
project(
'meson_template',
'cpp',
version: '0.0.1',
default_options : ['warning_level=3', 'werror=true', 'optimization=3', 'cpp_std=c++20']
)
# Directories where compiler is able to include from
project_include_directories = []
project_include_directories += include_directories('include')
# Subprojects (using meson wraps)
ut = subproject('ut')
project_dependencies = []
# Project sources
project_sources = []
# Subdirectors
subdir('docs')
subdir('include')
subdir('src')
subdir('tests')
executable(
'temp_executable',
project_sources,
include_directories : project_include_directories,
dependencies : project_dependencies
)
# 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.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