mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Makefile with task for updating glad
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
zig-cache/
|
||||
zig-out/
|
||||
/result*
|
||||
|
||||
glad.zip
|
||||
|
17
Makefile
Normal file
17
Makefile
Normal file
@ -0,0 +1,17 @@
|
||||
# glad updates the GLAD loader. To use this, place the generated glad.zip
|
||||
# in this directory next to the Makefile, remove vendor/glad and run this target.
|
||||
#
|
||||
# Generator: https://gen.glad.sh/
|
||||
glad: vendor/glad
|
||||
.PHONY: glad
|
||||
|
||||
vendor/glad: vendor/glad/include/glad/gl.h vendor/glad/include/glad/glad.h
|
||||
|
||||
vendor/glad/include/glad/gl.h: glad.zip
|
||||
rm -rf vendor/glad
|
||||
mkdir -p vendor/glad
|
||||
unzip glad.zip -dvendor/glad
|
||||
find vendor/glad -type f -exec touch '{}' +
|
||||
|
||||
vendor/glad/include/glad/glad.h: vendor/glad/include/glad/gl.h
|
||||
@echo "#include <glad/gl.h>" > $@
|
@ -20,8 +20,8 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
try ftgl.link(exe, b, target, mode, .{});
|
||||
|
||||
// GLAD
|
||||
exe.addIncludeDir("glad/include/");
|
||||
exe.addCSourceFile("glad/src/gl.c", &.{});
|
||||
exe.addIncludeDir("vendor/glad/include/");
|
||||
exe.addCSourceFile("vendor/glad/src/gl.c", &.{});
|
||||
|
||||
const ftlib = try ft.create(b, target, mode, .{});
|
||||
ftlib.link(exe);
|
||||
|
@ -1,2 +0,0 @@
|
||||
// Backwards compatibility
|
||||
#include <glad/gl.h>
|
@ -30,7 +30,7 @@ pub fn link(
|
||||
// C files
|
||||
ret.addCSourceFiles(srcs, flags.items);
|
||||
ret.addIncludeDir(root());
|
||||
ret.addIncludeDir(thisDir() ++ "../../glad/include");
|
||||
ret.addIncludeDir(thisDir() ++ "../../vendor/glad/include");
|
||||
ret.linkLibC();
|
||||
|
||||
// For config.h
|
||||
|
0
glad/include/KHR/khrplatform.h → vendor/glad/include/KHR/khrplatform.h
vendored
Executable file → Normal file
0
glad/include/KHR/khrplatform.h → vendor/glad/include/KHR/khrplatform.h
vendored
Executable file → Normal file
0
glad/include/glad/gl.h → vendor/glad/include/glad/gl.h
vendored
Executable file → Normal file
0
glad/include/glad/gl.h → vendor/glad/include/glad/gl.h
vendored
Executable file → Normal file
1
vendor/glad/include/glad/glad.h
vendored
Normal file
1
vendor/glad/include/glad/glad.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#include <glad/gl.h>
|
0
glad/src/gl.c → vendor/glad/src/gl.c
vendored
Executable file → Normal file
0
glad/src/gl.c → vendor/glad/src/gl.c
vendored
Executable file → Normal file
Reference in New Issue
Block a user