Skip to content

Commit 013c8c4

Browse files
committed
shift logic
1 parent 92c584b commit 013c8c4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/sdl2/build.zig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ pub fn build(b: *std.Build) void {
77
const optimize = b.standardOptimizeOption(.{});
88
const android_targets = android.standardTargets(b, root_target);
99

10-
const library_optimize = if (android_targets.len == 0)
11-
optimize
12-
else
13-
// For Android builds, make sure we build libraries with ReleaseSafe
14-
// otherwise we get errors relating to libubsan_rt.a getting RELOCATION errors
15-
// https://github.com/silbinarywolf/zig-android-sdk/issues/18
16-
if (optimize == .Debug) .ReleaseSafe else optimize;
17-
1810
var root_target_single = [_]std.Build.ResolvedTarget{root_target};
1911
const targets: []std.Build.ResolvedTarget = if (android_targets.len == 0)
2012
root_target_single[0..]
@@ -76,6 +68,14 @@ pub fn build(b: *std.Build) void {
7668
.optimize = optimize,
7769
});
7870

71+
const library_optimize = if (!target.result.abi.isAndroid())
72+
optimize
73+
else
74+
// In Zig 0.14.0, for Android builds, make sure we build libraries with ReleaseSafe
75+
// otherwise we get errors relating to libubsan_rt.a getting RELOCATION errors
76+
// https://github.com/silbinarywolf/zig-android-sdk/issues/18
77+
if (optimize == .Debug) .ReleaseSafe else optimize;
78+
7979
// add SDL2
8080
{
8181
const sdl_dep = b.dependency("sdl2", .{

0 commit comments

Comments
 (0)