File: meson.build

package info (click to toggle)
stdx-allocator 3.1.0~beta.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 560 kB
  • sloc: makefile: 7
file content (93 lines) | stat: -rw-r--r-- 2,696 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
project('stdx-allocator', 'd',
    meson_version: '>=0.45',
    license: 'BSL-1.0',
    version: '3.0.1'
)

project_soversion = '0'

mir_core_dep = dependency('mir-core', fallback : ['mir-core', 'mir_core_dep'])

required_deps = [mir_core_dep]

pkgc = import('pkgconfig')

#
# Sources
#
allocator_src = [
	'source/stdx/allocator/internal.d',
	'source/stdx/allocator/building_blocks/null_allocator.d',
	'source/stdx/allocator/building_blocks/fallback_allocator.d',
	'source/stdx/allocator/building_blocks/bitmapped_block.d',
	'source/stdx/allocator/building_blocks/stats_collector.d',
	'source/stdx/allocator/building_blocks/package.d',
	'source/stdx/allocator/building_blocks/affix_allocator.d',
	'source/stdx/allocator/building_blocks/free_list.d',
	'source/stdx/allocator/building_blocks/bucketizer.d',
	'source/stdx/allocator/building_blocks/free_tree.d',
	'source/stdx/allocator/building_blocks/kernighan_ritchie.d',
	'source/stdx/allocator/building_blocks/allocator_list.d',
	'source/stdx/allocator/building_blocks/segregator.d',
	'source/stdx/allocator/building_blocks/scoped_allocator.d',
	'source/stdx/allocator/building_blocks/region.d',
	'source/stdx/allocator/building_blocks/quantizer.d',
	'source/stdx/allocator/typed.d',
	'source/stdx/allocator/mmap_allocator.d',
	'source/stdx/allocator/showcase.d',
	'source/stdx/allocator/mallocator.d',
	'source/stdx/allocator/package.d',
	'source/stdx/allocator/common.d',
	'source/stdx/allocator/gc_allocator.d',
]

src_dir = include_directories('source/')

#
# Targets
#
allocator_lib = library('stdx-allocator',
	[allocator_src],
	include_directories: [src_dir],
	install: true,
	version: meson.project_version(),
	soversion: project_soversion,
	dependencies: required_deps,
)

#
# Tests
#
test_main_src = join_paths(meson.build_root(), 'utmain.d')
run_command('sh',
            ['-c', 'echo "void main () {}" > ' + test_main_src],
            check: true)
allocator_test_exe = executable(meson.project_name() + '-test',
    [allocator_src, test_main_src],
    include_directories: src_dir,
    d_unittest: true,
    dependencies: required_deps
)

# for use by Vibe.d and others which embed this as subproject
allocator_dep = declare_dependency(
    link_with: allocator_lib,
    include_directories: src_dir,
    dependencies: required_deps,
)

#
# Install
#
install_subdir('source/stdx/', install_dir: 'include/d/stdx-allocator/')


pkgc.generate(name: 'stdx-allocator',
	libraries: allocator_lib,
	requires: ['mir-core'],
	subdirs: 'd/' + meson.project_name(),
	version: meson.project_version(),
	description: 'High-level interface for allocators for D, extracted from Phobos.'
)

test(meson.project_name() + '-test', allocator_test_exe)