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
|
project('fg-engine', 'cpp',
default_options: ['warning_level=3', 'cpp_std=none'])
cpp = meson.get_compiler('cpp')
cmake = import('cmake')
rc_options = cmake.subproject_options()
rc_options.add_cmake_defines({'RC_ENABLE_CATCH': 'ON'})
rapidcheck_proj = cmake.subproject('rapidcheck', options: rc_options)
rapidcheck_dep = rapidcheck_proj.dependency('rapidcheck')
rapidcheck_catch_dep = rapidcheck_proj.dependency('rapidcheck_catch')
if cpp.get_id() in ['msvc', 'clang-cl']
add_project_arguments('/std:c++latest', language: 'cpp')
else
add_project_arguments('-std=c++23', language: 'cpp')
endif
add_project_arguments('-DCATCH_CONFIG_FAST_COMPILE', language: 'cpp')
sim_core = static_library('sim_core',
sources: files('src/fixed_point.cpp'),
include_directories: 'include',
)
sim_core_dep = declare_dependency(
link_with: sim_core,
include_directories: 'include',
)
catch2_dep = dependency('catch2-with-main')
test_exe = executable('fg-tests',
sources: files('tests/test_fixed_point.cpp'),
dependencies: [sim_core_dep, catch2_dep, rapidcheck_dep, rapidcheck_catch_dep],
)
test('unit tests', test_exe, args: ['-r', 'automake'])
|