-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmeson.build
43 lines (37 loc) · 989 Bytes
/
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
# SPDX-License-Identifier: Apache-2.0
# Copyright © 2021-2024 Intel Corporation
project(
'meson++',
['cpp'],
version : '0.0.1',
meson_version : '>= 0.55',
license : 'Apache-2.0',
default_options : ['cpp_std=c++17', 'c_std=c99'],
)
cpp = meson.get_compiler('cpp')
add_project_arguments(
cpp.get_supported_arguments(
'-Werror=switch-enum',
'-Werror=implicit-fallthrough',
'-Werror=return-type',
'-Werror=unused-result',
),
'-D_GNU_SOURCE',
language : 'cpp',
)
# Older versions of GCC and Clang require linking with special libraries to get
# std::filesystem support
dep_fs = dependency('', required : false)
if cpp.get_id() == 'gcc'
dep_fs = cpp.find_library('stdc++fs', required : false)
elif cpp.get_id() == 'clang'
dep_fs = cpp.find_library('c++fs', required : false)
endif
dep_gtest = dependency(
'gtest_main',
disabler : true,
required : get_option('tests'),
fallback : ['gtest', 'gtest_main_dep'],
)
subdir('src')
subdir('tests')