-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
72 lines (52 loc) · 2.01 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
project('Memarena', 'cpp', version : '0.1.0', default_options : ['cpp_std=c++20'])
add_project_arguments('-w', language : 'cpp')
if get_option('buildtype').startswith('debug')
add_project_arguments('-DMEMARENA_DEBUG', language : 'cpp')
endif
# ======== MEMARENA LIBRARY ========
sources = [
'Source/Allocator.cpp',
'Source/AllocatorUtils.cpp',
'Source/MemoryTracker.cpp',
'Source/Utility/Alignment/Alignment.cpp',
'Source/Utility/VirtualMemory.cpp'
]
dependencies = []
include_dir = [include_directories('Source')]
memarena_lib = library('Memarena', sources: sources, include_directories: include_dir, cpp_pch : 'Source/PCH.hpp')
memarena_dep = declare_dependency(
include_directories : [include_directories('Include')],
link_with : memarena_lib
)
# ======== TESTS ========
test_sources = [
'Tests/Source/Main.cpp',
'Tests/Source/StackAllocatorTest.cpp',
'Tests/Source/LinearAllocatorTest.cpp',
'Tests/Source/PoolAllocatorTest.cpp',
'Tests/Source/MallocatorTest.cpp',
'Tests/Source/FallbackAllocatorTest.cpp',
'Tests/Source/AlignmentTest.cpp',
'Tests/Source/MemoryTrackerTest.cpp'
]
gtest_dep = dependency('gtest')
test_dependencies = [gtest_dep, memarena_dep]
test_exe = executable('MemarenaTests', sources: test_sources , dependencies : test_dependencies)
test('MemarenaTests', test_exe)
# ======== BENCHMARKS ========
benchmark_sources = [
'Benchmarks/Source/Main.cpp',
'Benchmarks/Source/AllocationsBenchmark.cpp',
'Benchmarks/Source/StackAllocatorArrayAllocationsBenchmark.cpp',
'Benchmarks/Source/StackAllocatorAccessBenchmark.cpp',
'Benchmarks/Source/AlignmentBenchmark.cpp',
]
benchmark_dep = dependency('benchmark')
benchmark_dependencies = [benchmark_dep, memarena_dep]
benchmark_exe = executable('MemarenaBenchmarks', sources: benchmark_sources , dependencies : benchmark_dependencies)
# ======== EXAMPLE ========
example_sources = [
'Example/Source/Main.cpp',
]
example_dependencies = [memarena_dep]
example_exe = executable('MemarenaExample', sources: example_sources , dependencies : example_dependencies)