removed opengl from build.zig
This commit is contained in:
parent
0e08e5a055
commit
5dbfcdb5bf
1 changed files with 2 additions and 17 deletions
15
build.zig
15
build.zig
|
|
@ -63,23 +63,8 @@ pub fn build(b: *std.Build) void {
|
||||||
});
|
});
|
||||||
exe.addIncludePath(b.path("ext/glfw/include"));
|
exe.addIncludePath(b.path("ext/glfw/include"));
|
||||||
|
|
||||||
// If "opengl" was passed as an option, this statement will define USE_OPENGL,
|
|
||||||
// which will be checked inside renderer.zig, it will use the opengl backend if that was defined,
|
|
||||||
// else it won't thus the backend will be vulkan
|
|
||||||
const opengl = b.option(bool, "opengl", "Use OpenGL instead of Vulkan.") orelse false;
|
|
||||||
const options = b.addOptions();
|
|
||||||
options.addOption(bool, "opengl", opengl);
|
|
||||||
exe.root_module.addOptions("config", options);
|
|
||||||
if (opengl) {
|
|
||||||
exe.addIncludePath(b.path("ext/gl/include"));
|
|
||||||
exe.addCSourceFile(.{
|
|
||||||
.file = b.path("ext/gl/src/glad.c"),
|
|
||||||
.flags = &[_][]const u8{"-Iinclude"},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
exe.linkSystemLibrary("vulkan");
|
exe.linkSystemLibrary("vulkan");
|
||||||
compileAllShaders(b, exe);
|
compileAllShaders(b, exe);
|
||||||
}
|
|
||||||
exe.linkLibrary(glfw);
|
exe.linkLibrary(glfw);
|
||||||
exe.linkLibC();
|
exe.linkLibC();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue