diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/zstd/contrib/premake | |
parent | Initial commit. (diff) | |
download | ceph-b26c4052f3542036551aa9dec9caa4226e456195.tar.xz ceph-b26c4052f3542036551aa9dec9caa4226e456195.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/zstd/contrib/premake')
-rw-r--r-- | src/zstd/contrib/premake/premake4.lua | 6 | ||||
-rw-r--r-- | src/zstd/contrib/premake/zstd.lua | 80 |
2 files changed, 86 insertions, 0 deletions
diff --git a/src/zstd/contrib/premake/premake4.lua b/src/zstd/contrib/premake/premake4.lua new file mode 100644 index 000000000..6675e2e48 --- /dev/null +++ b/src/zstd/contrib/premake/premake4.lua @@ -0,0 +1,6 @@ +-- Include zstd.lua in your GENie or premake4 file, which exposes a project_zstd function +dofile('zstd.lua') + +solution 'example' + configurations { 'Debug', 'Release' } + project_zstd('../../lib/') diff --git a/src/zstd/contrib/premake/zstd.lua b/src/zstd/contrib/premake/zstd.lua new file mode 100644 index 000000000..df1ace3ee --- /dev/null +++ b/src/zstd/contrib/premake/zstd.lua @@ -0,0 +1,80 @@ +-- This GENie/premake file copies the behavior of the Makefile in the lib folder. +-- Basic usage: project_zstd(ZSTD_DIR) + +function project_zstd(dir, compression, decompression, deprecated, dictbuilder, legacy) + if compression == nil then compression = true end + if decompression == nil then decompression = true end + if deprecated == nil then deprecated = false end + if dictbuilder == nil then dictbuilder = false end + + if legacy == nil then legacy = 0 end + + if not compression then + dictbuilder = false + deprecated = false + end + + if not decompression then + legacy = 0 + deprecated = false + end + + project 'zstd' + kind 'StaticLib' + language 'C' + + files { + dir .. 'zstd.h', + dir .. 'common/**.c', + dir .. 'common/**.h' + } + + if compression then + files { + dir .. 'compress/**.c', + dir .. 'compress/**.h' + } + end + + if decompression then + files { + dir .. 'decompress/**.c', + dir .. 'decompress/**.h' + } + end + + if dictbuilder then + files { + dir .. 'dictBuilder/**.c', + dir .. 'dictBuilder/**.h' + } + end + + if deprecated then + files { + dir .. 'deprecated/**.c', + dir .. 'deprecated/**.h' + } + end + + if legacy ~= 0 then + if legacy >= 8 then + files { + dir .. 'legacy/zstd_v0' .. (legacy - 7) .. '.*' + } + end + includedirs { + dir .. 'legacy' + } + end + + includedirs { + dir, + dir .. 'common' + } + + defines { + 'XXH_NAMESPACE=ZSTD_', + 'ZSTD_LEGACY_SUPPORT=' .. legacy + } +end |