@@ -5,7 +5,8 @@ pub fn build(b: *std.Build) void {
5
5
const optimize = b .standardOptimizeOption (.{});
6
6
const t = target .result ;
7
7
8
- const is_shared_library = t .isAndroid ();
8
+ const is_android = if (@hasDecl (@TypeOf (t ), "isAndroid" )) t .isAndroid () else t .abi .isAndroid ();
9
+ const is_shared_library = is_android ;
9
10
const lib = if (! is_shared_library ) b .addStaticLibrary (.{
10
11
.name = "SDL2" ,
11
12
.target = target ,
@@ -74,7 +75,7 @@ pub fn build(b: *std.Build) void {
74
75
lib .addIncludePath (.{ .cwd_relative = cache_include });
75
76
},
76
77
else = > {
77
- if (t . isAndroid () ) {
78
+ if (is_android ) {
78
79
lib .root_module .addCSourceFiles (.{
79
80
.files = & android_src_files ,
80
81
});
@@ -115,7 +116,7 @@ pub fn build(b: *std.Build) void {
115
116
116
117
const use_pregenerated_config = switch (t .os .tag ) {
117
118
.windows , .macos , .emscripten = > true ,
118
- .linux = > t . isAndroid () ,
119
+ .linux = > is_android ,
119
120
else = > false ,
120
121
};
121
122
@@ -165,7 +166,7 @@ pub fn build(b: *std.Build) void {
165
166
lib .installHeader (revision_header .getOutput (), "SDL2/SDL_revision.h" );
166
167
}
167
168
168
- const use_hidapi = b .option (bool , "use_hidapi" , "Use hidapi shared library" ) orelse t . isAndroid () ;
169
+ const use_hidapi = b .option (bool , "use_hidapi" , "Use hidapi shared library" ) orelse is_android ;
169
170
170
171
if (use_hidapi ) {
171
172
const hidapi_lib = b .addSharedLibrary (.{
@@ -1183,7 +1184,7 @@ fn configHeader(b: *std.Build, t: std.Target) *std.Build.Step.ConfigHeader {
1183
1184
.HAVE_SETJMP = 1 ,
1184
1185
.HAVE_NANOSLEEP = 1 ,
1185
1186
.HAVE_SYSCONF = 1 ,
1186
- .HAVE_SYSCTLBYNAME = t .isDarwin (),
1187
+ .HAVE_SYSCTLBYNAME = t .os . tag . isDarwin (),
1187
1188
.HAVE_CLOCK_GETTIME = 1 ,
1188
1189
.HAVE_GETPAGESIZE = 1 ,
1189
1190
.HAVE_MPROTECT = 1 ,
0 commit comments