Merge pull request #1665 from lzutao/meson-deprecated-warnings
meson: Fix deprecated build warnings on build options
This commit is contained in:
commit
068cc18927
27
.travis.yml
27
.travis.yml
@ -190,18 +190,23 @@ matrix:
|
|||||||
compiler: clang
|
compiler: clang
|
||||||
install:
|
install:
|
||||||
- sudo apt-get install -qq liblz4-dev valgrind tree
|
- sudo apt-get install -qq liblz4-dev valgrind tree
|
||||||
- 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
|
travis_retry curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' &&
|
||||||
- travis_retry curl -o ~/get-pip.py -L 'https://bootstrap.pypa.io/get-pip.py'
|
unzip ~/ninja.zip -d ~/.local/bin
|
||||||
&& python3 ~/get-pip.py --user
|
- |
|
||||||
&& pip3 install --user meson
|
travis_retry curl -o ~/get-pip.py -L 'https://bootstrap.pypa.io/get-pip.py' &&
|
||||||
|
python3 ~/get-pip.py --user &&
|
||||||
|
pip3 install --user meson
|
||||||
script:
|
script:
|
||||||
- meson setup
|
- |
|
||||||
--buildtype=debugoptimized
|
meson setup \
|
||||||
-Db_lundef=false
|
--buildtype=debugoptimized \
|
||||||
-Dauto_features=enabled
|
-Db_lundef=false \
|
||||||
-Dbuild_{programs,tests,contrib}=true
|
-Dauto_features=enabled \
|
||||||
-Ddefault_library=both
|
-Dbin_programs=true \
|
||||||
|
-Dbin_tests=true \
|
||||||
|
-Dbin_contrib=true \
|
||||||
|
-Ddefault_library=both \
|
||||||
build/meson builddir
|
build/meson builddir
|
||||||
- pushd builddir
|
- pushd builddir
|
||||||
- ninja
|
- ninja
|
||||||
|
@ -17,7 +17,7 @@ It outputs one `libzstd`, either shared or static, depending on
|
|||||||
`cd` to this meson directory (`build/meson`)
|
`cd` to this meson directory (`build/meson`)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
meson --buildtype=release -Dbuild_{programs,contrib}=true builddir
|
meson setup -Dbin_programs=true -Dbin_contrib=true builddir
|
||||||
cd builddir
|
cd builddir
|
||||||
ninja # to build
|
ninja # to build
|
||||||
ninja install # to install
|
ninja install # to install
|
||||||
|
@ -17,6 +17,7 @@ gen_html_includes = include_directories(join_paths(zstd_rootdir, 'programs'),
|
|||||||
gen_html = executable('gen_html',
|
gen_html = executable('gen_html',
|
||||||
join_paths(zstd_rootdir, 'contrib/gen_html/gen_html.cpp'),
|
join_paths(zstd_rootdir, 'contrib/gen_html/gen_html.cpp'),
|
||||||
include_directories: gen_html_includes,
|
include_directories: gen_html_includes,
|
||||||
|
native: true,
|
||||||
install: false)
|
install: false)
|
||||||
|
|
||||||
# Update zstd manual
|
# Update zstd manual
|
||||||
|
@ -75,9 +75,9 @@ legacy_level = get_option('legacy_level')
|
|||||||
use_backtrace = get_option('backtrace')
|
use_backtrace = get_option('backtrace')
|
||||||
use_static_runtime = get_option('static_runtime')
|
use_static_runtime = get_option('static_runtime')
|
||||||
|
|
||||||
build_programs = get_option('build_programs')
|
bin_programs = get_option('bin_programs')
|
||||||
build_contrib = get_option('build_contrib')
|
bin_contrib = get_option('bin_contrib')
|
||||||
build_tests = get_option('build_tests')
|
bin_tests = get_option('bin_tests')
|
||||||
|
|
||||||
feature_multi_thread = get_option('multi_thread')
|
feature_multi_thread = get_option('multi_thread')
|
||||||
feature_zlib = get_option('zlib')
|
feature_zlib = get_option('zlib')
|
||||||
@ -88,7 +88,7 @@ feature_lz4 = get_option('lz4')
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
libm_dep = cc.find_library('m', required: build_tests)
|
libm_dep = cc.find_library('m', required: bin_tests)
|
||||||
thread_dep = dependency('threads', required: feature_multi_thread)
|
thread_dep = dependency('threads', required: feature_multi_thread)
|
||||||
use_multi_thread = thread_dep.found()
|
use_multi_thread = thread_dep.found()
|
||||||
# Arguments in dependency should be equivalent to those passed to pkg-config
|
# Arguments in dependency should be equivalent to those passed to pkg-config
|
||||||
@ -133,14 +133,14 @@ endif
|
|||||||
|
|
||||||
subdir('lib')
|
subdir('lib')
|
||||||
|
|
||||||
if build_programs
|
if bin_programs
|
||||||
subdir('programs')
|
subdir('programs')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if build_tests
|
if bin_tests
|
||||||
subdir('tests')
|
subdir('tests')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if build_contrib
|
if bin_contrib
|
||||||
subdir('contrib')
|
subdir('contrib')
|
||||||
endif
|
endif
|
||||||
|
@ -19,11 +19,11 @@ option('backtrace', type: 'boolean', value: false,
|
|||||||
option('static_runtime', type: 'boolean', value: false,
|
option('static_runtime', type: 'boolean', value: false,
|
||||||
description: 'Link to static run-time libraries on MSVC')
|
description: 'Link to static run-time libraries on MSVC')
|
||||||
|
|
||||||
option('build_programs', type: 'boolean', value: true,
|
option('bin_programs', type: 'boolean', value: true,
|
||||||
description: 'Enable programs build')
|
description: 'Enable programs build')
|
||||||
option('build_tests', type: 'boolean', value: false,
|
option('bin_tests', type: 'boolean', value: false,
|
||||||
description: 'Enable tests build')
|
description: 'Enable tests build')
|
||||||
option('build_contrib', type: 'boolean', value: false,
|
option('bin_contrib', type: 'boolean', value: false,
|
||||||
description: 'Enable contrib build')
|
description: 'Enable contrib build')
|
||||||
|
|
||||||
option('multi_thread', type: 'feature', value: 'enabled',
|
option('multi_thread', type: 'feature', value: 'enabled',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user