Currently our product (a dynamic library) has separate ARM and x86 versions on MacOS, and now I'm trying to make universal binary. However, it relies on some precompiled close-source static libraries that only has x86 code or arm64 code. How should I feed them to the linker? Does it works correctly & silently by just feed them altogether, or there's some part-specific parameters?
Especially, does CMake has specific support on it (so I can keep use of our current interface imported library wrapping)? Or I have to do it through custom linker options?
I found that the linker could automatically choose whether to actually use a static library according to the architecture of the lib and the current linking piece, only spawning some warnings when architecture is conflict. So what I should do is to feed all x86 and arm64 libraries to the linker.
Though this approach looks dirty, it works.