Browse Source

Added miniz for compression/decompression

master
Macoy Madson 6 months ago
parent
commit
6f5a4bc89b
  1. 2
      ReadMe.org
  2. 30
      src/Compression.cake
  3. 10
      src/miniz_export.h

2
ReadMe.org

@ -94,6 +94,7 @@ Here are the known compatibility results, where blank means untested/unknown:
| Allocator.cake | Yes | Yes | Yes | Yes |
| Aubio.cake | Yes | | | |
| AutoTest.cake | Yes | Yes | Yes | Yes |
| Compression.cake | Yes | | | |
| Config_ZigCompile.cake | Yes | | | |
| Config_ZigWindows.cake | Yes | | | |
| Cryptography.cake | Yes | | | |
@ -132,6 +133,7 @@ Here are the known compatibility results, where blank means untested/unknown:
The following modules will automatically download their dependencies if missing:
- Aubio.cake
- Compression.cake
- Cryptography.cake
- Curl.cake
- ZigCompile.cake[3]

30
src/Compression.cake

@ -0,0 +1,30 @@
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(add-cakelisp-search-directory "Dependencies/gamelib/src")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(add-cakelisp-search-directory "src")
(import "CHelpers.cake" "BuildTools.cake"
"Dependencies.cake")
(comptime-cond
('auto-test
(c-import "<stdio.h>" "miniz.h")
(defun test--compression (&return int)
(fprintf stderr "miniz version %s\n" (mz_version))
(return 0))))
(add-c-search-directory-module "Dependencies/miniz"
"Dependencies/gamelib/src"
;; For GameLibTests.cake
"../src")
(add-c-build-dependency
"miniz.c"
"miniz_tdef.c"
"miniz_tinfl.c"
"miniz_zip.c")
(add-dependency-git-submodule
clone-miniz
"https://github.com/richgel999/miniz.git"
"Dependencies/miniz")

10
src/miniz_export.h

@ -0,0 +1,10 @@
// This is for Compression.cake to build miniz without CMake
#ifdef WINDOWS
#ifdef MINIZ_EXPORTING
#define MINIZ_EXPORT __declspec(dllexport)
#else
#define MINIZ_EXPORT __declspec(dllimport)
#endif
#else
#define MINIZ_EXPORT
#endif
Loading…
Cancel
Save