In my quest to get SDL working with zig, I am currently trying out this addObjectFile thing. It's looking like it is not simple to build SDL for iOS inside the zig ecosystem. So instead I am trying a prebuilt ios library.
const lib = b.addLibrary(.{
.linkage = .static,
.name = "cc-ios",
.root_module = mod,
});
platform_setup(b, &target, lib);
lib.addObjectFile(b.path("libs/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3.a"));
b.verbose_link = true;
b.installArtifact(lib);
I know that _SDL_Init is in there:
% nm libs/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3.a | grep _SDL_Init
000000000011d67c T _SDL_Init
But after building it is clearly not linked.
% nm ios/cc/libcc-ios.a | grep _SDL_Init
U _SDL_Init
What am I missing. Can I get this prebuilt downloaded SDL3 library linked to my zig library using addObjectFile or am I misunderstanding something?