zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit beef9fdf42726d8cfe3017ff3017767fb615ef08 (tree)
parent f9ebe0daa2aacb582ca94c1970ec02cc8c39fd75
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Mon,  4 May 2026 16:28:46 -0700

remove ios standalone test

relied on setting sysroot in configure phase

let's examine this use case more carefully next time before reinstating
this test.

Diffstat:
Mtest/standalone/build.zig.zon | 3---
Dtest/standalone/ios/build.zig | 40----------------------------------------
Dtest/standalone/ios/main.m | 34----------------------------------
3 files changed, 0 insertions(+), 77 deletions(-)

diff --git a/test/standalone/build.zig.zon b/test/standalone/build.zig.zon @@ -153,9 +153,6 @@ .compiler_rt_panic = .{ .path = "compiler_rt_panic", }, - .ios = .{ - .path = "ios", - }, .depend_on_main_mod = .{ .path = "depend_on_main_mod", }, diff --git a/test/standalone/ios/build.zig b/test/standalone/ios/build.zig @@ -1,40 +0,0 @@ -const std = @import("std"); - -pub const requires_symlinks = true; -pub const requires_ios_sdk = true; - -pub fn build(b: *std.Build) void { - const test_step = b.step("test", "Test it"); - b.default_step = test_step; - - const optimize: std.builtin.OptimizeMode = .Debug; - const target = b.resolveTargetQuery(.{ - .cpu_arch = .aarch64, - .os_tag = .ios, - }); - - const exe = b.addExecutable(.{ - .name = "main", - .root_module = b.createModule(.{ - .root_source_file = null, - .optimize = optimize, - .target = target, - .link_libc = true, - }), - }); - - const io = b.graph.io; - - if (std.zig.system.darwin.getSdk(b.allocator, io, &target.result)) |sdk| { - b.sysroot = sdk; - exe.root_module.addSystemIncludePath(.{ .cwd_relative = b.pathJoin(&.{ sdk, "/usr/include" }) }); - exe.root_module.addSystemFrameworkPath(.{ .cwd_relative = b.pathJoin(&.{ sdk, "/System/Library/Frameworks" }) }); - exe.root_module.addLibraryPath(.{ .cwd_relative = b.pathJoin(&.{ sdk, "/usr/lib" }) }); - } else { - exe.step.dependOn(&b.addFail("no iOS SDK found").step); - } - - exe.root_module.addCSourceFile(.{ .file = b.path("main.m"), .flags = &.{} }); - exe.root_module.linkFramework("Foundation", .{}); - exe.root_module.linkFramework("UIKit", .{}); -} diff --git a/test/standalone/ios/main.m b/test/standalone/ios/main.m @@ -1,34 +0,0 @@ -#import <UIKit/UIKit.h> - -@interface AppDelegate : UIResponder <UIApplicationDelegate> -@property (strong, nonatomic) UIWindow *window; -@end - -int main() { - @autoreleasepool { - return UIApplicationMain(0, nil, nil, NSStringFromClass([AppDelegate class])); - } -} - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(id)options { - CGRect mainScreenBounds = [[UIScreen mainScreen] bounds]; - self.window = [[UIWindow alloc] initWithFrame:mainScreenBounds]; - UIViewController *viewController = [[UIViewController alloc] init]; - viewController.view.frame = mainScreenBounds; - - NSString* msg = @"Hello world"; - - UILabel *label = [[UILabel alloc] initWithFrame:mainScreenBounds]; - [label setText:msg]; - [viewController.view addSubview: label]; - - self.window.rootViewController = viewController; - - [self.window makeKeyAndVisible]; - - return YES; -} - -@end