Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ pub fn build(b: *std.Build) !void {
assert(sdl_so_version.major == 3);
sdl_so_version.major = 0;

const sdl_vendor_info = std.fmt.comptimePrint("\"{s} {s}\"", .{"https://github.com/allyourcodebase/SDL", build_zon.version});

// Create the library
const lib = b.addLibrary(.{
.name = "SDL3",
Expand All @@ -81,10 +83,7 @@ pub fn build(b: *std.Build) !void {
},
.static => lib.root_module.addCMacro("SDL_STATIC_LIB", "1"),
}
lib.root_module.addCMacro("SDL_VENDOR_INFO", std.fmt.comptimePrint("\"{s} {s}\"", .{
"https://github.com/allyourcodebase/SDL",
build_zon.version,
}));
lib.root_module.addCMacro("SDL_VENDOR_INFO", sdl_vendor_info);
lib.installHeadersDirectory(upstream.path("include/SDL3"), "SDL3", .{});
b.installArtifact(lib);

Expand Down Expand Up @@ -147,6 +146,7 @@ pub fn build(b: *std.Build) !void {
.optimize = optimize orelse std.builtin.OptimizeMode.Debug,
});
translate_c.defineCMacro("USING_GENERATED_CONFIG_H", "1");
translate_c.defineCMacro("SDL_VENDOR_INFO", sdl_vendor_info);
translate_c.addIncludePath(upstream.path("include"));
translate_c.addIncludePath(upstream.path("src/video/khronos"));
const module = translate_c.addModule("sdl3");
Expand Down
3 changes: 3 additions & 0 deletions src/sdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
// Include the main SDL header, this header provides most other SDL headers.
#include <SDL3/SDL.h>

// Include the SDL revision header, this header defines the SDL_REVISION macro.
#include <SDL3/SDL_revision.h>

// This is not pulling in the full Vulkan API to every build. It's just pulling in a few functions
// that can be called to load the API and integrate with SDL.
#include <SDL3/SDL_vulkan.h>
Expand Down