-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
44 lines (34 loc) · 998 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
44
# SPDX-FileCopyrightText: 2024 Peter Urban, Ghent University
#
# SPDX-License-Identifier: CC0-1.0
# --- Project ---
# Define project meta data
project(
'demonstrate-meson-openmp',
'cpp',
license: 'MPL-2.0',
version: '1.0.0',
default_options: ['warning_level=2', 'buildtype=release', 'cpp_std=c++20'],
meson_version: '>=1.4' #latest tested version
)
# --- dependencies ---
demolib_compile_args = []
if meson.get_compiler('cpp').get_id() != 'msvc'
demolib_compile_args = ['-Werror=unknown-pragmas']
endif
# openmp
openmp = dependency('openmp')
# if meson.get_compiler('cpp').get_id() == 'clang-cl'
# openmp = declare_dependency(
# compile_args: ['/openmp:experimental'],
# )
# endif
# --- build targets ---
# add c++ src
subdir('src')
# -- tests (catch2) --
if get_option('build_tests').enabled()
catch2 = subproject('catch2', default_options: ['tests=false', 'install=false'])
catch2 = catch2.get_variable('catch2_with_main_dep')
subdir('tests')
endif