This removes a linker hack which was preventing building with the latest
Zig master version. Of particular note, anyone wishing to use this library
will need to ensure they are up to date with latest master.
The binary releases available at https://ziglang.org/download/ (1783+eec825c and
beyond) are sufficient (really, anything released after today.)
Fixeshexops/mach#103
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This effectively gives us the dependencies we need in any case, and works around ziglang/zig#10103
Importantly, this removes a blocker for landing WebGPU support in hexops/mach#62
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This refactors the logic for system SDK inclusion out of the GLFW-specific `build.zig`,
and should make it very easy for anyone to copy this file and start getting cross-platform
builds of their own OpenGL/Vulkan Zig projects.
There may be some libraries we need to add for Vulkan to these SDKs, I haven't yet tested
that - but the overall idea here seems sound.
Fixeshexops/mach#39
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Previously, @Avokadoen and @mattnite ran into issues including the GLFW library
in other projects, e.g. https://github.com/Avokadoen/zig_vulkan/issues/17
In #24 we removed the intermediate static library, which solved the issue. The
problem is that when the function is invoked in the directory of the project
including GLFW, then our code:
```
const lib = b.addStaticLibrary("glfw", "src/main.zig");
```
Would refer to the project's `src/main.zig` -- not the GLFW library `main.zig`.
Although removing the intermediate lib worked around the issue, it created a
new one - slower compilation: hexops/mach#31
This fixes the issue by ensuring that the path we pass to `addStaticLibrary` is
in fact absolute, not relative.
Fixeshexops/mach#31
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This change makes it easier to test SDKs locally, e.g. if you have:
```
% tree projects/
projects
├── mach
│ └── glfw
└── sdk-macos-11.3
```
In the `projects/mach/glfw` directory it is now easy to test changes to `sdk-macos-11.3` using:
```sh
SDK_PATH="$(pwd)/../.." zig build test -Dtarget=aarch64-macos
```
And it'll use your local SDK, instead of the one in the appdata dir.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>