diff --git a/.travis.yml b/.travis.yml index 6771c61..dbda060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,11 @@ d: - dmd-nightly - ldc-latest-ci +before_install: + - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update && sudo apt-get -y install ninja-build python3-pip python3-setuptools; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ninja; fi + - pip3 install meson + matrix: include: # Last FE GDC is compatible with diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..35f909e --- /dev/null +++ b/meson.build @@ -0,0 +1,13 @@ +project('taggedalgebraic', 'd', + meson_version: '>=0.50', + version: '0.11.9' +) + +project_soversion = '0' +project_version_suffix = '' +project_version = meson.project_version() +project_version_full = project_version + project_version_suffix + +source_root = meson.source_root() +build_root = meson.build_root() +subdir('source/taggedalgebraic') diff --git a/source/taggedalgebraic/meson.build b/source/taggedalgebraic/meson.build new file mode 100644 index 0000000..920f715 --- /dev/null +++ b/source/taggedalgebraic/meson.build @@ -0,0 +1,35 @@ +taggedalgebraic_src = [ + 'taggedalgebraic.d', + 'taggedunion.d', + 'visit.d', +] + +taggedalgebraic_lib = library( + 'taggedalgebraic', + taggedalgebraic_src, + version: project_version, + install: true, + include_directories: include_directories('../') +) + +pkgc = import('pkgconfig') + +pkgc.generate( + taggedalgebraic_lib, + subdirs: 'd/taggedalgebraic', +) + +install_headers( + taggedalgebraic_src, + subdir: 'd/taggedalgebraic/taggedalgebraic', +) + +test_exe = executable( + 'taggedalgebraic_test', + taggedalgebraic_src, + include_directories: include_directories('../'), + d_unittest: true, + link_args: '-main', +) + +test('test_taggedalgebraic', test_exe) diff --git a/source/taggedalgebraic/taggedalgebraic.d b/source/taggedalgebraic/taggedalgebraic.d index cb9eb43..ad297ab 100644 --- a/source/taggedalgebraic/taggedalgebraic.d +++ b/source/taggedalgebraic/taggedalgebraic.d @@ -139,7 +139,7 @@ struct TaggedAlgebraic(U) if (is(U == union) || is(U == struct) || is(U == enum) /// @safe unittest { - import taggedalgebraic; + import taggedalgebraic.taggedalgebraic; struct Foo { string name; diff --git a/travis.sh b/travis.sh index de2efb7..725aea3 100755 --- a/travis.sh +++ b/travis.sh @@ -9,5 +9,7 @@ if [ ! -z "${COVERAGE:-}" ]; then wget https://codecov.io/bash -O codecov.sh bash codecov.sh else - dub test + dub test + meson build + ninja -C build fi