Skip to content

Techatrix/glfw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

glfw

This is glfw, packaged for Zig.

Installation

First, update your build.zig.zon:

# Initialize a `zig build` project if you haven't already
zig init
zig fetch --save git+https://github.com/Techatrix/glfw.git

You can then import glfw in your build.zig with:

const glfw_dependency = b.dependency("glfw", .{
    .target = target,
    .optimize = optimize,
    // Uncomment to always fetch dependency header
    // files instead of using pre-bundled ones.
    // .@"prefer-bundled-headers" = false,
});
your_exe.root_module.linkLibrary(glfw_dependency.artifact("glfw"));

Pre-Bundled Dependencies

GLFW internally requires header files from various projects:

  • wayland-protocols generated using wayland-scanner
  • wayland-client
  • wayland-cursor
  • wayland-egl
  • libxkbcommon
  • xorgproto
  • libx11
  • libxrandr
  • libxinerama
  • libxcursor
  • libxi
  • libxext
  • libxrender
  • libxfixes

By default, this repository avoids fetching from all of these projects and instead uses pre-bundled header files that can be found in the deps directory.

The following options are offered to opt into alternative approaches:

  • Fetch from upstream repositories which can be enabled using -Dprefer-bundled-headers=false.
  • Lookup dependencies on the host system which can be enabled using Zig's System Integration Options.

Update

The header files have been collected using the following command:

zig build -Donly-install-dependency-headers -Dprefer-bundled-headers=false -Dx11 -Dwayland --prefix deps

About

glfw ported to the zig build system

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages