Compiling and linking against glfw+glew

Hello, I am trying to make a minimal opengl triangle window using 0.14.0-dev.1457+7e3180487. I tried using addCSourceFile to add the necessary library sources, but this doesn’t work. Glew, at least, contains a main function, and it needs to be compiled into a static lib, and then linked against.
I don’t want to depend on a build.zig.zon, would anyone have a 0.14 example that makes a static c lib and then links it all in one build.zig?
I am still in my zig baby steps, please bear with me.
Here is my build.zig so far:

Hello @soymaxxer

A fork of GLFW packaged for the Zig build system looks like what you are looking for.

Welcome to ziggit :slight_smile:

1 Like

Thanks!
I saw that repo a while ago, but I don’t like the idea of fetching the header zips from mach’s servers, especially that mach doesn’t use glfw anymore, and they might disappear.
I would like to have my whole project self contained, without relying on the package manager: make the .a and then link it.

I am not proposing to use it. I am proposing to copy it. Just remove the build.zig.zon dependencies and use the logic from build.zig keeping the sources in src and include folders.