summaryrefslogtreecommitdiffstats
path: root/third_party/zstd/moz.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /third_party/zstd/moz.build
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/zstd/moz.build')
-rw-r--r--third_party/zstd/moz.build107
1 files changed, 107 insertions, 0 deletions
diff --git a/third_party/zstd/moz.build b/third_party/zstd/moz.build
new file mode 100644
index 0000000000..6bcc264981
--- /dev/null
+++ b/third_party/zstd/moz.build
@@ -0,0 +1,107 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Core', 'Networking')
+
+EXPORTS.zstd += [
+ 'lib/zstd.h',
+]
+
+UNIFIED_SOURCES += [
+ 'lib/common/debug.c',
+ 'lib/common/entropy_common.c',
+ 'lib/common/error_private.c',
+ 'lib/common/fse_decompress.c',
+ 'lib/common/pool.c',
+ 'lib/common/threading.c',
+ 'lib/common/xxhash.c',
+ 'lib/common/zstd_common.c',
+ 'lib/decompress/huf_decompress.c',
+ 'lib/decompress/zstd_ddict.c',
+ 'lib/decompress/zstd_decompress.c',
+ 'lib/decompress/zstd_decompress_block.c',
+]
+
+# we aren't using these currently
+#COMPRESS_SOURCES = [
+# 'lib/compress/fse_compress.c',
+# 'lib/compress/hist.c',
+# 'lib/compress/huf_compress.c',
+# 'lib/compress/zstd_compress.c',
+# 'lib/compress/zstd_compress_literals.c',
+# 'lib/compress/zstd_compress_sequences.c',
+# 'lib/compress/zstd_compress_superblock.c',
+# 'lib/compress/zstd_double_fast.c',
+# 'lib/compress/zstd_fast.c',
+# 'lib/compress/zstd_lazy.c',
+# 'lib/compress/zstd_ldm.c',
+# 'lib/compress/zstd_opt.c',
+# 'lib/compress/zstdmt_compress.c',
+#]
+
+CFLAGS += [
+ '-Wall',
+ '-Wextra',
+ '-Wcast-qual',
+ '-Wcast-align',
+ '-Wshadow',
+ '-Wstrict-aliasing=1',
+ '-Wswitch-enum',
+ '-Wdeclaration-after-statement',
+ '-Wstrict-prototypes',
+ '-Wundef',
+ '-Wpointer-arith',
+ '-Wvla',
+ '-Wformat=2',
+ '-Winit-self',
+ '-Wfloat-equal',
+ '-Wwrite-strings',
+ '-Wredundant-decls',
+ '-Wmissing-prototypes',
+ '-Wc++-compat'
+]
+
+CXXFLAGS += [
+ '-DXXH_NAMESPACE=ZSTD_',
+ '-DDEBUGLEVEL=0',
+ '-DZSTD_MULTITHREAD=1',
+]
+
+LOCAL_INCLUDES += [ 'lib/decompress' ]
+
+# .S assembler format is incompatible with Microsoft MASM, disable for now
+if CONFIG["OS_ARCH"] == "WINNT":
+ CXXFLAGS += [ '-DZSTD_DISABLE_ASM=1' ]
+else:
+ # If the assembler format is made compatible, we still need to preprocess it
+ if CONFIG["TARGET_CPU"] == "x86_64" and CONFIG["OS_ARCH"] == "WINNT":
+ if CONFIG["CC_TYPE"] == "clang-cl":
+ # libffi asm needs to be preprocessed for MSVC's assembler
+ GeneratedFile("win64_intel.asm",
+ inputs=[
+ "lib/decompress/huf_decompress_amd64.S",
+ ],
+ script="preprocess_asm.py",
+ flags=["$(DEFINES)", "$(LOCAL_INCLUDES)"],
+ )
+ SOURCES += ["!win64_intel.asm"]
+ else:
+ SOURCES += [
+ 'lib/decompress/huf_decompress_amd64.S',
+ ]
+ else:
+ SOURCES += [
+ 'lib/decompress/huf_decompress_amd64.S',
+ ]
+
+# We allow warnings for third-party code that can be updated from upstream.
+AllowCompilerWarnings()
+
+Library('zstd')
+
+FINAL_LIBRARY = 'xul'
+