Repository navigation
Add optional shared library build - #5
BoatsMcGee wants to merge 2 commits into
Conversation
Add Windows support patch and build
A patch is data applied to files whose line endings are fixed by whoever fetched them. With core.autocrlf=true the working copy was rewritten to CRLF, and git apply then failed with 'patch does not apply' because the context no longer matched the LF cvvdp.c that Zig extracts. Marking *.patch -text stops git converting it, so the file is committed and checked out byte for byte.
|
Hi @BoatsMcGee, Thanks for the change! Can you resolve the merge conflicts, address the comments, and refresh your PR? |
| #include <math.h> | ||
| #include <unistd.h> | ||
|
|
||
| +#ifdef _WIN32 |
There was a problem hiding this comment.
Via the README:
Compilation requires Zig ≥0.17.0 & a macOS, Linux, or Unix-like operating system.
Windows is explicitly unsupported and will not be supported officially at any point, sorry – I maintain this stance because I do not have Windows hardware and can't guarantee Windows as a first-class support target. Thus this file can be removed.
| @@ -0,0 +1,36 @@ | |||
| ; Windows module definition for the optional shared library (-Dshared=true). | |||
There was a problem hiding this comment.
Via the README:
Compilation requires Zig ≥0.17.0 & a macOS, Linux, or Unix-like operating system.
Windows is explicitly unsupported and will not be supported officially at any point, sorry – I maintain this stance because I do not have Windows hardware and can't guarantee Windows as a first-class support target. Thus this file can be removed.
| @@ -0,0 +1,5 @@ | |||
| # Patch files are data, not source: they are applied to files whose line | |||
There was a problem hiding this comment.
Via the README:
Compilation requires Zig ≥0.17.0 & a macOS, Linux, or Unix-like operating system.
Windows is explicitly unsupported and will not be supported officially at any point, sorry – I maintain this stance because I do not have Windows hardware and can't guarantee Windows as a first-class support target. This file is only useful for the Windows support patch, thus this file can be removed.
| const optimize = b.standardOptimizeOption(.{}); | ||
| const strip = b.option(bool, "strip", "strip symbols from the binary, defaults to false") orelse false; | ||
| const flto = b.option(bool, "flto", "enable Link Time Optimization, defaults to false") orelse false; | ||
| const shared = b.option(bool, "shared", "also build and install a shared library (.dll/.so/.dylib), defaults to false") orelse false; |
There was a problem hiding this comment.
Remove .dll – see previous comments.
| }), | ||
| }); | ||
| shared_lib.root_module.linkLibrary(lib); | ||
| // Only Windows needs an explicit export list; a DLL there exports |
There was a problem hiding this comment.
Remove everything here related to Windows, and clean up the comments – there are far too many comments in here.
| Compilation requires [Zig](https://ziglang.org/) ≥0.16.0 & a macOS, Linux, or | ||
| Unix-like operating system. To compile, run: | ||
| Compilation requires [Zig](https://ziglang.org/) ≥0.16.0. macOS, Linux, and | ||
| Windows are supported; Windows needs one extra step, described below. To |
|
I'm afraid I need to preserve the changes for Windows in order to support users of my applications and outputting a shared library build was merely a means to that end so I will not be removing them. However, you have my permission to extract and use the handful of changed/added lines in Thank you, |
-Dshared=trueoption to additionally output a shared library (.so,.dll,.dylib).I built the CLI and ran it on a png and a y4m - both compared to themselves as a smoke test:
Thanks,
- Boats M.