Skip to content
Merged
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
17 changes: 13 additions & 4 deletions examples/sdl2/third-party/sdl2/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,24 @@ pub fn build(b: *std.Build) !void {
// lib.installHeadersDirectory("include", "SDL");
b.installArtifact(lib);

var module = b.addModule("sdl", .{
var sdl_c_module = b.addTranslateC(.{
// NOTE(jae): 2025-03-13
// Using host target platform to avoid include errors when targetting Android
// Otherwise we get errors like: 'sys/types.h' file not found
.target = b.graph.host,
.optimize = .ReleaseFast,
.root_source_file = b.path("src/sdl.zig"),
.root_source_file = b.path("src/sdl.h"),
});
if (sdl_config_header) |config_header| {
module.addConfigHeader(config_header);
sdl_c_module.addConfigHeader(config_header);
}
module.addIncludePath(sdl_include_path);
sdl_c_module.addIncludePath(sdl_include_path);

_ = b.addModule("sdl", .{
.target = target,
.optimize = optimize,
.root_source_file = sdl_c_module.getOutput(),
});
}

const generic_src_files = [_][]const u8{
Expand Down
1 change: 1 addition & 0 deletions examples/sdl2/third-party/sdl2/src/sdl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <SDL.h>
3 changes: 0 additions & 3 deletions examples/sdl2/third-party/sdl2/src/sdl.zig

This file was deleted.