macOS: CheckFunctionExists/CheckSymbolExists does not select the correct architecture building on arm64
Not sure, if this is a bug at all or rather a wrong assumption on my side. But compiling a cmake target on Apple Silicon (arm64 target), I was under the assumption, that cmake will take the default architecture for that platform into account (which is arm64). Instead it is obligatory to provide -DCMAKE_OSX_ARCHITECTURES=arm64 to be able to correctly run checks like "CheckFunctionExists" or similar.
If those checks are run, the system explicitly builds them for x86_64, failing any linking against arm64-only libraries. Not sure how, because the exact same command-line (taken from the CMakeError.log) runs fine and links correctly if run from the terminal.
CheckSymbolExists is affected the same way.
Edited by Brad King