I'm struggling with compiling lib opus so that it works in the simulator on Apple silicon. I found a thread on the forums that seems to address part of the issue, but I am unable to build the static lib so that it shows the platform it is targeting.
The thread mentions that I should be able to run otool and see a "load commands" that indicate the platform.
When I run otool against the static library that we have created, it doesn't list any load commands. I don't see LC_BUILD_VERSION or LC_VERSION_MIN_***. Why would there not be any "Load command" entries?
% otool -l -arch arm64 dependencies/lib/libopus.a
Archive : dependencies/lib/libopus.a
dependencies/lib/libopus.a(bands.o): is an LLVM bit-code file
dependencies/lib/libopus.a(celt.o): is an LLVM bit-code file
dependencies/lib/libopus.a(celt_encoder.o): is an LLVM bit-code file
dependencies/lib/libopus.a(celt_decoder.o): is an LLVM bit-code file
...
dependencies/lib/libopus.a(mlp.o): is an LLVM bit-code file
dependencies/lib/libopus.a(mlp_data.o): is an LLVM bit-code file
The static library has the two architectures embedded in it, but when compiling the framework for the simulator platform the linking phase complains that we are building for the simulator, but linking object code built for ios.
% lipo -info dependencies/lib/libopus.a
Architectures in the fat file: dependencies/lib/libopus.a are: x86_64 arm64
In case you are curious, I'm just piggybacking on this project that has a build-libopus.sh script in the root directory that builds the official open source Opus library files. My hope is to build this static library for ios, ios-simulator, and mac-catalyst platforms and then include them in a xcframework.