]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
meson: allow -Dlegacy_support=true, fix -Dlegacy_support=0 968/head
authorShawn Landden <slandden@gmail.com>
Mon, 25 Dec 2017 00:01:15 +0000 (16:01 -0800)
committerShawn Landden <slandden@gmail.com>
Fri, 29 Dec 2017 18:18:33 +0000 (10:18 -0800)
contrib/meson/meson.build
contrib/meson/meson_options.txt

index b045c99443c9ca8ba2e484f61ef1cf01b93839fc..079c045a11740831483d6891215ff511c8ef8306 100644 (file)
@@ -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')
index de9fea073cf2db89464bfcf7759d7aac40bb69fb..99845c8aa5131a6b38a153fe2db99a05db477b11 100644 (file)
@@ -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+.')