From ea41b580eb20848e9383b705be34341d6f950fa8 Mon Sep 17 00:00:00 2001 From: Shawn Landden Date: Sun, 24 Dec 2017 16:01:15 -0800 Subject: [PATCH] meson: allow -Dlegacy_support=true, fix -Dlegacy_support=0 --- contrib/meson/meson.build | 10 ++++++++++ contrib/meson/meson_options.txt | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/meson/meson.build b/contrib/meson/meson.build index b045c994..079c045a 100644 --- a/contrib/meson/meson.build +++ b/contrib/meson/meson.build @@ -39,9 +39,19 @@ libzstd_srcs = [ libzstd_includes = [include_directories(common_dir, dictbuilder_dir, compress_dir, lib_dir)] legacy = get_option('legacy_support') +if legacy == '0' + legacy = 'false' +endif if legacy != 'false' + if legacy == 'true' + legacy = '1' + endif + #See ZSTD_LEGACY_SUPPORT of programs/README.md message('Enabling legacy support back to version 0.' + legacy) legacy_int = legacy.to_int() + if legacy_int > 7 + legacy_int = 7 + endif libzstd_cflags = ['-DZSTD_LEGACY_SUPPORT=' + legacy] legacy_dir = join_paths(lib_dir, 'legacy') diff --git a/contrib/meson/meson_options.txt b/contrib/meson/meson_options.txt index de9fea07..99845c8a 100644 --- a/contrib/meson/meson_options.txt +++ b/contrib/meson/meson_options.txt @@ -1,2 +1,3 @@ option('multithread', type: 'boolean', value: false) -option('legacy_support', type: 'string', value: '4') +option('legacy_support', type: 'string', value: '4', + description: 'True or false, or 7 to 1 for v0.7+ to v0.1+.')