Hello!
Recently I left the issue that explains my problem. I have the cross-platform game that uses SDL2. I do build my own copy of SDL2 from the source via CMake together with my game’s build. I do use the SDL 2.0.14 stable version copy at me. I link the SDL2 into my game statically.
So, when I compile the game on x86_64 into ARM64 (by specifying the -DCMAKE_OSX_ARCHITECTURES="arm64"
cmake flag), the final result won’t work: it fails to run the thread because of no threads support, and it fails to create the window at all. My friend who owns the M1 machine, had a theory that this failure is a result because I used the Catalina as a build environment. He did an attempt to build the library and the game using his x86_64 BigSur machine. However, this build also won’t work on the M1. However, when building the game on the M1 itself, it works successfully. The faulty build appears when do the cross-compilation from x86_64.
This is a big problem, because all public macOS CI builders I know using x86_64 architecture only, and I don’t own M1 by myself. So, the only a cross-compilation allows me to build the game for M1 architecture. Is this a failure of the Apple side, or there is some thing possible at SDL2 CMake build? Anyway, when I built the SDL2, the log has shown that all parts got found, built and linked properly, but in the runtime it won’t work at all.