Skip to content

Commit a1fe386

Browse files
committed
fix meson build, update travis
1 parent ab615cd commit a1fe386

File tree

2 files changed

+46
-25
lines changed

2 files changed

+46
-25
lines changed

.travis.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
language: d
12
dist: trusty
23
sudo: required
34
os:
45
- linux
56
- osx
6-
language: d
7+
packages:
8+
- pkg-config
79
d:
810
- ldc
911
- ldc-beta
1012
- dmd-nightly
1113
- dmd-beta
1214
- dmd
13-
- gdc
15+
branches:
16+
only:
17+
- master
1418
env:
1519
- ARCH="x86_64"
1620
matrix:
@@ -23,13 +27,21 @@ matrix:
2327
- {d: dmd-nightly}
2428
- {d: ldc-beta}
2529
- {d: gdc}
26-
branches:
27-
only:
28-
- master
30+
install:
31+
- pyenv global system 3.6
32+
- pip3 install 'meson>=0.45'
33+
- mkdir .ntmp
34+
- curl -L https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip -o .ntmp/ninja-linux.zip
35+
- unzip .ntmp/ninja-linux.zip -d .ntmp
36+
before_script:
37+
- export PATH=$PATH:$PWD/.ntmp
2938
script:
3039
- travis_wait 100 dub test --arch "$ARCH"
3140
- ./test_examples.sh
3241
- travis_wait 100 dub test --arch "$ARCH" --build=unittest-cov
3342
- travis_wait 100 dub test --arch "$ARCH" --build=unittest-release
43+
- meson build && ninja -j8 -C build # TODO: 32bit meson test
44+
- ninja -j8 -C build test -v
45+
3446
after_success:
3547
- bash <(curl -s https://codecov.io/bash)

meson.build

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
project('mir-algorithm', 'd', version : '2.0.0')
22

3-
pversion = meson.project_version()
4-
name = meson.project_name()
5-
vname = name + '-' + pversion
63

7-
the_src = [
4+
install_subdir('include/',
5+
strip_directory :true,
6+
install_dir: 'include/',
7+
)
8+
9+
install_subdir('source/',
10+
strip_directory : true,
11+
install_dir: 'include/d/' + meson.project_name(),
12+
)
13+
14+
mir_algorithm_dir = include_directories('source/')
15+
16+
mir_algorithm_src = [
817
'source/mir/algorithm/iteration.d',
918
'source/mir/algorithm/setops.d',
1019
'source/mir/array/allocation.d',
@@ -55,27 +64,27 @@ the_src = [
5564
'source/std/backdoor.d',
5665
]
5766

58-
mir_algorithm_lib = library(name,
59-
[the_src],
60-
install: true,
61-
version: pversion,
62-
include_directories: [include_directories('source')],
67+
mir_algorithm_test_exe = executable(meson.project_name() + '-test',
68+
mir_algorithm_src,
69+
include_directories: mir_algorithm_dir,
70+
d_unittest: true,
71+
d_module_versions: ['mir_test'],
72+
link_args: '-main',
6373
)
6474

65-
install_subdir('include/',
66-
strip_directory :true,
67-
install_dir: 'include/',
68-
)
75+
test(meson.project_name() + '-test', mir_algorithm_test_exe)
6976

70-
install_subdir('source/',
71-
strip_directory : true,
72-
install_dir: 'include/d/' + vname,
77+
mir_algorithm_lib = library(meson.project_name(),
78+
mir_algorithm_src,
79+
include_directories: mir_algorithm_dir,
80+
install: true,
81+
version: meson.project_version(),
7382
)
7483

7584
import('pkgconfig').generate(
76-
name: name,
77-
description: 'Mir Algorithm - Dlang Core Library for math and finance.',
78-
subdirs: 'd/' + vname,
85+
name: meson.project_name(),
86+
description: 'Mir Algorithm - Dlang Core Library for Math and Finance.',
87+
subdirs: 'd/' + meson.project_name(),
7988
libraries: [mir_algorithm_lib],
80-
version: pversion,
89+
version: meson.project_version(),
8190
)

0 commit comments

Comments
 (0)