zstd.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. -- This GENie/premake file copies the behavior of the Makefile in the lib folder.
  2. -- Basic usage: project_zstd(ZSTD_DIR)
  3. function project_zstd(dir, compression, decompression, deprecated, dictbuilder, legacy)
  4. if compression == nil then compression = true end
  5. if decompression == nil then decompression = true end
  6. if deprecated == nil then deprecated = false end
  7. if dictbuilder == nil then dictbuilder = false end
  8. if legacy == nil then legacy = 0 end
  9. if not compression then
  10. dictbuilder = false
  11. deprecated = false
  12. end
  13. if not decompression then
  14. legacy = 0
  15. deprecated = false
  16. end
  17. project 'zstd'
  18. kind 'StaticLib'
  19. language 'C'
  20. files {
  21. dir .. 'zstd.h',
  22. dir .. 'common/**.c',
  23. dir .. 'common/**.h'
  24. }
  25. if compression then
  26. files {
  27. dir .. 'compress/**.c',
  28. dir .. 'compress/**.h'
  29. }
  30. end
  31. if decompression then
  32. files {
  33. dir .. 'decompress/**.c',
  34. dir .. 'decompress/**.h'
  35. }
  36. end
  37. if dictbuilder then
  38. files {
  39. dir .. 'dictBuilder/**.c',
  40. dir .. 'dictBuilder/**.h'
  41. }
  42. end
  43. if deprecated then
  44. files {
  45. dir .. 'deprecated/**.c',
  46. dir .. 'deprecated/**.h'
  47. }
  48. end
  49. if legacy ~= 0 then
  50. if legacy >= 8 then
  51. files {
  52. dir .. 'legacy/zstd_v0' .. (legacy - 7) .. '.*'
  53. }
  54. end
  55. includedirs {
  56. dir .. 'legacy'
  57. }
  58. end
  59. includedirs {
  60. dir,
  61. dir .. 'common'
  62. }
  63. defines {
  64. 'XXH_NAMESPACE=ZSTD_',
  65. 'ZSTD_LEGACY_SUPPORT=' .. legacy
  66. }
  67. end