From dd54ea01a207a65d4819db4222066373f6170113 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sat, 27 Apr 2019 01:41:03 +0700 Subject: contrib: Make Meson build non optional * Update ninja version to 1.9 in CI. * Update default project version in meson script. --- .travis.yml | 6 +++--- contrib/meson/meson.build | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c684b6c..8ebcdfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -172,13 +172,13 @@ matrix: - tests/checkTag "$TRAVIS_BRANCH" - name: (Xenial) Meson + clang build - env: ALLOW_FAILURES=true + #env: ALLOW_FAILURES=true dist: xenial language: cpp compiler: clang install: - sudo apt-get install -qq python3 tree - - curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip' + - curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' && unzip ~/ninja.zip -d ~/.local/bin - curl -o ~/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' && python3 ~/get-pip.py --user @@ -191,7 +191,7 @@ matrix: -Ddefault_library=both -Dbuild_{programs,contrib,tests,examples}=true contrib/meson build - - cd build + - pushd build - DESTDIR=./staging ninja install - tree ./staging allow_failures: diff --git a/contrib/meson/meson.build b/contrib/meson/meson.build index bf30eae..7e364eb 100644 --- a/contrib/meson/meson.build +++ b/contrib/meson/meson.build @@ -11,7 +11,9 @@ project('lz4', ['c'], license: ['BSD', 'GPLv2'], default_options : ['c_std=c99', 'buildtype=release'], - version: '1.8.3', + # Fall-back version in case of extracting version number from + # `lz4.h` failed. + version: '1.9.1', meson_version: '>=0.47.0') cc = meson.get_compiler('c') -- cgit v0.12 From cb1be75c84e9b49c82634fe9be5f968087c98df8 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 30 Apr 2019 12:25:40 +0700 Subject: meson: Rely only on extracted version in lz4.h So now instead of warning when failing to extract version number from lz4.h, we error and stop the build instead. --- .travis.yml | 4 ++-- contrib/meson/meson.build | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ebcdfa..ee643e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -178,9 +178,9 @@ matrix: compiler: clang install: - sudo apt-get install -qq python3 tree - - curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' + - travis_retry curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' && unzip ~/ninja.zip -d ~/.local/bin - - curl -o ~/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' + - travis_retry curl -o ~/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' && python3 ~/get-pip.py --user && pip3 install --user meson script: diff --git a/contrib/meson/meson.build b/contrib/meson/meson.build index 7e364eb..c28d90a 100644 --- a/contrib/meson/meson.build +++ b/contrib/meson/meson.build @@ -11,9 +11,7 @@ project('lz4', ['c'], license: ['BSD', 'GPLv2'], default_options : ['c_std=c99', 'buildtype=release'], - # Fall-back version in case of extracting version number from - # `lz4.h` failed. - version: '1.9.1', + version: 'DUMMY', meson_version: '>=0.47.0') cc = meson.get_compiler('c') @@ -40,13 +38,10 @@ lz4_h_file = join_paths(meson.current_source_dir(), '../../lib/lz4.h') GetLz4LibraryVersion_py = files('GetLz4LibraryVersion.py') r = run_command(python3, GetLz4LibraryVersion_py, lz4_h_file) if r.returncode() == 0 - output = r.stdout().strip() - if output.version_compare('>@0@'.format(lz4_version)) - lz4_version = output - message('Project version is now: @0@'.format(lz4_version)) - endif + lz4_version = r.stdout().strip() + message('Project version is now: @0@'.format(lz4_version)) else - warning('Cannot find project version in @0@'.format(lz4_h_file)) + error('Cannot find project version in @0@'.format(lz4_h_file)) endif lz4_libversion = lz4_version -- cgit v0.12