2023-05-21 21:33:10 +02:00
|
|
|
-- 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
|
|
|
|
|
|
2025-07-31 09:02:01 +02:00
|
|
|
project "zstd"
|
|
|
|
|
kind "StaticLib"
|
|
|
|
|
language "C"
|
2023-05-21 21:33:10 +02:00
|
|
|
|
|
|
|
|
files {
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "zstd.h",
|
|
|
|
|
dir .. "common/**.c",
|
|
|
|
|
dir .. "common/**.h"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if compression then
|
|
|
|
|
files {
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "compress/**.c",
|
|
|
|
|
dir .. "compress/**.h"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if decompression then
|
|
|
|
|
files {
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "decompress/**.c",
|
|
|
|
|
dir .. "decompress/**.h"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if dictbuilder then
|
|
|
|
|
files {
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "dictBuilder/**.c",
|
|
|
|
|
dir .. "dictBuilder/**.h"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if deprecated then
|
|
|
|
|
files {
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "deprecated/**.c",
|
|
|
|
|
dir .. "deprecated/**.h"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if legacy ~= 0 then
|
|
|
|
|
if legacy >= 8 then
|
|
|
|
|
files {
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "legacy/zstd_v0" .. (legacy - 7) .. ".*"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
includedirs {
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "legacy"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
includedirs {
|
|
|
|
|
dir,
|
2025-07-31 09:02:01 +02:00
|
|
|
dir .. "common"
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defines {
|
2025-07-31 09:02:01 +02:00
|
|
|
"XXH_NAMESPACE=ZSTD_",
|
2025-01-19 19:13:57 +01:00
|
|
|
-- See here on why: https://gitlab.kitware.com/cmake/cmake/-/issues/25744
|
2025-07-31 09:02:01 +02:00
|
|
|
"ZSTD_DISABLE_ASM=1",
|
|
|
|
|
"ZSTD_LEGACY_SUPPORT=" .. legacy
|
2023-05-21 21:33:10 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group("third_party")
|
|
|
|
|
project("zstd")
|
|
|
|
|
uuid("df336aac-f0c8-11ed-a05b-0242ac120003")
|
2025-07-31 09:02:01 +02:00
|
|
|
project_zstd("./zstd/lib/")
|