66
77const std = @import ("std" );
88const builtin = @import ("builtin" );
9- const log = std .log ;
9+ const log = std .log . scoped ( .build ) ;
1010
1111const android = @import ("android" );
1212
@@ -20,12 +20,6 @@ pub fn build(b: *std.Build) void {
2020 const optimize = b .standardOptimizeOption (.{});
2121 const android_targets = android .standardTargets (b , root_target );
2222
23- // NOTE(jae): 2026-04-12
24- // Run it *after* the "standardTargets" call
25- if (is_latest_stable_zig ) {
26- testLazyImportAndResolveTargets (b , root_target );
27- }
28-
2923 var root_target_single = [_ ]std.Build.ResolvedTarget {root_target };
3024 const targets : []std.Build.ResolvedTarget = if (android_targets .len == 0 )
3125 root_target_single [0.. ]
@@ -53,6 +47,10 @@ pub fn build(b: *std.Build) void {
5347 };
5448
5549 for (targets ) | target | {
50+ if (! target .result .abi .isAndroid ()) {
51+ std .debug .panic ("For testing Android builds only. Target(s) should be Android not: {t}" , .{target .result .abi });
52+ }
53+
5654 const translate_c_vendored_mod = testTranslateCVendor (b , target , optimize ) orelse return ;
5755
5856 const app_module = b .createModule (.{
@@ -142,27 +140,6 @@ fn testTranslateCExternal(b: *std.Build, target: std.Build.ResolvedTarget, optim
142140 return trans_libandroid .mod ;
143141}
144142
145- /// Test calling lazyImport and then calling "resolveTargets"
146- ///
147- /// PR: https://github.com/silbinarywolf/zig-android-sdk/pull/83
148- fn testLazyImportAndResolveTargets (b : * std.Build , root_target : std.Build.ResolvedTarget ) void {
149- const all_android_targets = true ;
150- const android_targets : []std.Build.ResolvedTarget = blk : {
151- if (all_android_targets or root_target .result .abi .isAndroid ()) {
152- if (b .lazyImport (@This (), "lazy_android" )) | lazy_android | {
153- break :blk lazy_android .resolveTargets (b , .{
154- .default_target = root_target ,
155- .all_targets = true ,
156- });
157- }
158- }
159- break :blk &[0 ]std.Build.ResolvedTarget {};
160- };
161- if (android_targets .len != 4 ) @panic ("expected 'resolveTargets' it to return 4 Android targets" );
162-
163- log .info ("testLazyImportAndResolveTargets: check that resolving android targets worked. Got: {}" , .{android_targets .len });
164- }
165-
166143/// Test the addLibraryFile functionality
167144///
168145/// Requested feature here: https://github.com/silbinarywolf/zig-android-sdk/issues/77
0 commit comments