Build a configuration-matched Cargo archive from Meson and flatten its object members into static libzstd. This gives C consumers one archive even though the migrated Rust objects and remaining C code refer to each other. Shared libraries whole-archive the Cargo output to retain Rust-only ABI exports. The implementation supports Meson 0.50's generated-archive linking rules, matching HUF mode and 32-bit configuration, and documents cross-build target and archiver selection. Test Plan: - fresh Meson both-build smoke consumers and invalidDictionaries - modern static/shared/both, forced-HUF, i686, install, and fuzzer paths - real Meson 0.50 static and shared smoke builds - cargo clippy, cargo clippy --benches, cargo clippy --tests, and nightly fmt Refs: build/meson/README.md archive and cross-build documentation
50 lines
2.5 KiB
Meson
50 lines
2.5 KiB
Meson
# #############################################################################
|
|
# Copyright (c) 2018-present Dima Krasner <dima@dimakrasner.com>
|
|
# lzutao <taolzu(at)gmail.com>
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under both the BSD-style license (found in the
|
|
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
# in the COPYING file in the root directory of this source tree).
|
|
# #############################################################################
|
|
|
|
# Read guidelines from https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
|
|
|
|
option('legacy_level', type: 'integer', min: 0, max: 7, value: 5,
|
|
description: 'Support any legacy format: 7 to 1 for v0.7+ to v0.1+')
|
|
option('debug_level', type: 'integer', min: 0, max: 9, value: 1,
|
|
description: 'Enable run-time debug. See lib/common/debug.h')
|
|
option('backtrace', type: 'feature', value: 'disabled',
|
|
description: 'Display a stack backtrace when execution generates a runtime exception')
|
|
option('static_runtime', type: 'boolean', value: false,
|
|
description: 'Link to static run-time libraries on MSVC')
|
|
|
|
option('bin_programs', type: 'boolean', value: true,
|
|
description: 'Enable programs build')
|
|
option('bin_tests', type: 'boolean', value: false,
|
|
description: 'Enable tests build')
|
|
option('bin_contrib', type: 'boolean', value: false,
|
|
description: 'Enable contrib build')
|
|
|
|
option('multi_thread', type: 'feature', value: 'enabled',
|
|
description: 'Enable multi-threading when pthread or Windows is detected')
|
|
option('zlib', type: 'feature', value: 'auto',
|
|
description: 'Enable zlib support')
|
|
option('lzma', type: 'feature', value: 'auto',
|
|
description: 'Enable lzma support')
|
|
option('lz4', type: 'feature', value: 'auto',
|
|
description: 'Enable lz4 support')
|
|
|
|
# The migrated compatibility modules are compiled by Cargo. A cross build
|
|
# needs the corresponding Rust target triple; leave it empty for native
|
|
# builds (or 32-bit Linux, which is detected automatically).
|
|
option('zstd_rust_target', type: 'string', value: '',
|
|
description: 'Cargo target triple for the Rust compatibility archive')
|
|
option('zstd_rust_archiver', type: 'string', value: '',
|
|
description: 'Archiver used to merge Rust objects into libzstd (default: ar)')
|
|
|
|
option('huf_force_decompress_x1', type: 'boolean', value: false,
|
|
description: 'Force the Huffman X1 decoder in C and Rust')
|
|
option('huf_force_decompress_x2', type: 'boolean', value: false,
|
|
description: 'Force the Huffman X2 decoder in C and Rust')
|