Skip to content

Commit 6cf1551

Browse files
authored
Merge pull request #106 from ximion/master
Add Meson build definition merged-on-behalf-of: Brian Schott <Hackerpilot@users.noreply.github.com>
2 parents cc402d6 + 08927fa commit 6cf1551

File tree

3 files changed

+112
-7
lines changed

3 files changed

+112
-7
lines changed

.travis.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
sudo: false
2-
31
language: d
2+
sudo: false
3+
dist: trusty
44

55
addons:
6-
apt:
7-
packages:
8-
gcc-multilib
6+
apt:
7+
packages:
8+
- pkg-config
9+
- gcc-multilib
10+
11+
install:
12+
- pyenv global system 3.6
13+
- pip3 install 'meson>=0.45'
14+
- mkdir .ntmp
15+
- curl -L https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip -o .ntmp/ninja-linux.zip
16+
- unzip .ntmp/ninja-linux.zip -d .ntmp
17+
18+
before_script:
19+
export PATH=$PATH:$PWD/.ntmp
920

1021
script:
11-
- git submodule update --init --recursive
12-
- make -B -C test/
22+
- meson build && ninja -j8 -C build
23+
- ninja -j8 -C build test -v
24+
- git submodule update --init --recursive
25+
- make -B -C test/

meson.build

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
project('dcontainers', 'd',
2+
meson_version: '>=0.44',
3+
license: 'BSL-1.0',
4+
version: '0.8.0'
5+
)
6+
7+
project_soversion = '0'
8+
9+
pkgc = import('pkgconfig')
10+
allocator_dep = dependency('stdx-allocator', version: '>= 2.77', fallback: ['stdx-allocator', 'allocator_dep'])
11+
12+
#
13+
# Sources
14+
#
15+
dcontainers_src = [
16+
'src/containers/cyclicbuffer.d',
17+
'src/containers/dynamicarray.d',
18+
'src/containers/hashmap.d',
19+
'src/containers/hashset.d',
20+
'src/containers/immutablehashset.d',
21+
'src/containers/internal/backwards.d',
22+
'src/containers/internal/element_type.d',
23+
'src/containers/internal/hash.d',
24+
'src/containers/internal/mixins.d',
25+
'src/containers/internal/node.d',
26+
'src/containers/internal/storage_type.d',
27+
'src/containers/openhashset.d',
28+
'src/containers/package.d',
29+
'src/containers/simdset.d',
30+
'src/containers/slist.d',
31+
'src/containers/treemap.d',
32+
'src/containers/ttree.d',
33+
'src/containers/unrolledlist.d'
34+
]
35+
36+
src_dir = include_directories('src/')
37+
38+
#
39+
# Targets
40+
#
41+
dcontainers_lib = library('dcontainers',
42+
[dcontainers_src],
43+
include_directories: [src_dir],
44+
install: true,
45+
version: meson.project_version(),
46+
soversion: project_soversion,
47+
dependencies: [allocator_dep]
48+
)
49+
50+
pkgc.generate(name: 'dcontainers',
51+
libraries: [dcontainers_lib],
52+
subdirs: 'd/containers',
53+
requires: ['stdx-allocator'],
54+
version: meson.project_version(),
55+
description: 'Containers backed by std.experimental.allocator.'
56+
)
57+
58+
# for use by others which embed this as subproject
59+
dcontainers_dep = declare_dependency(
60+
link_with: [dcontainers_lib],
61+
include_directories: [src_dir],
62+
dependencies: [allocator_dep]
63+
)
64+
65+
#
66+
# Tests
67+
#
68+
dcontainers_test_exe = executable('test_dcontainers',
69+
[dcontainers_src,
70+
'test/compile_test.d',
71+
'test/external_allocator_test.d'],
72+
include_directories: [src_dir],
73+
dependencies: [allocator_dep],
74+
d_unittest: true,
75+
link_args: '-main'
76+
)
77+
test('test_dcontainers', dcontainers_test_exe)
78+
79+
# the looptest is a manual test, so we don't run it and only compile it
80+
looptest_test_exe = executable('test_looptest',
81+
['test/looptest.d'],
82+
dependencies: [dcontainers_dep]
83+
)
84+
85+
#
86+
# Install
87+
#
88+
install_subdir('src/containers/', install_dir: 'include/d/containers/')

subprojects/stdx-allocator.wrap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[wrap-git]
2+
directory = stdx-allocator
3+
url = https://github.com/dlang-community/stdx-allocator.git
4+
revision = head

0 commit comments

Comments
 (0)