forked from mirror/vulkan-zig
Add Khronos license information to generated bindings
This commit is contained in:
@@ -6,6 +6,9 @@ const mem = std.mem;
|
||||
const Allocator = mem.Allocator;
|
||||
|
||||
const preamble =
|
||||
\\
|
||||
\\// This file is generated from the Khronos Vulkan XML API Registry
|
||||
\\
|
||||
\\const std = @import("std");
|
||||
\\const builtin = @import("builtin");
|
||||
\\const root = @import("root");
|
||||
@@ -294,6 +297,7 @@ fn Renderer(comptime WriterType: type) type {
|
||||
}
|
||||
|
||||
fn render(self: *Self) !void {
|
||||
try self.renderCopyright();
|
||||
try self.writer.writeAll(preamble);
|
||||
|
||||
for (self.registry.api_constants) |api_constant| {
|
||||
@@ -309,6 +313,13 @@ fn Renderer(comptime WriterType: type) type {
|
||||
try self.renderWrappers();
|
||||
}
|
||||
|
||||
fn renderCopyright(self: *Self) !void {
|
||||
var it = mem.split(self.registry.copyright, "\n");
|
||||
while (it.next()) |line| {
|
||||
try self.writer.print("// {}\n", .{line});
|
||||
}
|
||||
}
|
||||
|
||||
fn renderApiConstant(self: *Self, api_constant: reg.ApiConstant) !void {
|
||||
try self.writer.writeAll("pub const ");
|
||||
try self.renderName(api_constant.name);
|
||||
|
||||
Reference in New Issue
Block a user