-
Notifications
You must be signed in to change notification settings - Fork 2
Update for Zig 0.16.0 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| # Initialize a `zig build` project if you haven't already | ||
| zig init | ||
| zig fetch --save git+https://github.com/allyourcodebase/zstd.git#1.5.7 | ||
| zig fetch --save git+https://github.com/allyourcodebase/zstd.git#master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will tag a new release of this PR has been merged. This should be reverted.
| zig fetch --save git+https://github.com/allyourcodebase/zstd.git#master | |
| zig fetch --save git+https://github.com/allyourcodebase/zstd.git#1.5.7 |
|
|
||
| ## Options | ||
|
|
||
| ``` | ||
| -Dlinkage=[enum] Link mode. Defaults to static | ||
| Supported Values: | ||
| static | ||
| dynamic | ||
| -Dstrip=[bool] Omit debug information | ||
| -Dpie=[bool] Produce Position Independent Code | ||
| -Dcompression=[bool] build compression module | ||
| -Ddecompression=[bool] build decompression module | ||
| -Ddictbuilder=[bool] build dictbuilder module | ||
| -Ddeprecated=[bool] build deprecated module | ||
| -Dminify=[bool] Configures a bunch of other options to space-optimized defaults | ||
| -Dlegacy-support=[int] makes it possible to decompress legacy zstd formats | ||
| -Dmulti-thread=[bool] Enable multi-threading | ||
| -Ddisable-assembly=[bool] Assembly support | ||
| -Dhuf-force-decompress-x1=[bool] | ||
| -Dhuf-force-decompress-x2=[bool] | ||
| -Dforce-decompress-sequences-short=[bool] | ||
| -Dforce-decompress-sequences-long=[bool] | ||
| -Dno-inline=[bool] Disable Inlining | ||
| -Dstrip-error-strings=[bool] removes the error messages that are otherwise returned by `ZSTD_getErrorName` (implied by `-Dminify`) | ||
| -Dexclude-compressors-dfast-and-up=[bool] | ||
| -Dexclude-compressors-greedy-and-up=[bool] | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can run zig build -h to get this output so there is no need to provide a copy in the readme that may eventually get outdated. Please remove it.
| .root_module = b.createModule(.{ | ||
| .target = target, | ||
| .optimize = optimize, | ||
| .strip = strip, | ||
| .pic = pic, | ||
| .link_libc = true, | ||
| }), | ||
| .root_module = module, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the diff unnecessarily complicated. Can you keep the b.createModule call inside the b.addLibrary call and then just replace zstd.addSomething with zstd.root_module.addSomething wherever needed.
| .root_module = b.createModule(.{ | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }), | ||
| .root_module = mod, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the diff unnecessarily complicated. Can you keep the b.createModule call inside the b.addExecutable call and then just replace exe.addSomething with exe.root_module.addSomething.
| This is [zstd](https://github.com/facebook/zstd), packaged for [Zig](https://ziglang.org/). | ||
|
|
||
| Compatible with zig `0.14`-`0.16` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A statement like "Compatible with zig 0.16" is misleading because there is no 0.16.0 release (yet). You would have to mention the exact Zig version this has been tested with or say 0.16.0-dev. This can easily get outdated over time so I'd suggest to remove this statement entirely and let the user test whether it works with their Zig version instead.
Also, projects in allyourcodebase only need to guarantee support for the latest tagged release. Anything beyond that may change over time.
The following methods now apply to the module instead of the compile step:
addCSourceFilesaddIncludePathlinkLibrary