File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
examples/sdl2/third-party/sdl2 Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -169,15 +169,24 @@ pub fn build(b: *std.Build) !void {
169169 // lib.installHeadersDirectory("include", "SDL");
170170 b .installArtifact (lib );
171171
172- var module = b .addModule ("sdl" , .{
172+ var sdl_c_module = b .addTranslateC (.{
173+ // NOTE(jae): 2025-03-13
174+ // Using host target platform to avoid include errors when targetting Android
175+ // Otherwise we get errors like: 'sys/types.h' file not found
173176 .target = b .graph .host ,
174177 .optimize = .ReleaseFast ,
175- .root_source_file = b .path ("src/sdl.zig " ),
178+ .root_source_file = b .path ("src/sdl.h " ),
176179 });
177180 if (sdl_config_header ) | config_header | {
178- module .addConfigHeader (config_header );
181+ sdl_c_module .addConfigHeader (config_header );
179182 }
180- module .addIncludePath (sdl_include_path );
183+ sdl_c_module .addIncludePath (sdl_include_path );
184+
185+ _ = b .addModule ("sdl" , .{
186+ .target = target ,
187+ .optimize = optimize ,
188+ .root_source_file = sdl_c_module .getOutput (),
189+ });
181190}
182191
183192const generic_src_files = [_ ][]const u8 {
Original file line number Diff line number Diff line change 1+ #include <SDL.h>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments