Skip to content

APPLE: Check if compilers respect CMAKE_OSX_ARCHITECTURES

René Bertin requested to merge RJVB/cmake:RJVB-issue25952 into master

Not all compilers that can be used on APPLE platforms will respect the architecture(s) set in CMAKE_OSX_ARCHITECTURES and some will not raise an error is they are unable to do this. For instance, GCC will accept ignore additional architectures specified after the first -arch XXX (with a non-fatal warning) and will even link the simple test applications used in the ABI determination (and other tests that don't require external libraries) if an architecture is requested for which it doesn't have the required "multilib" set-up.

Prevent unexpected build results or build failures that may occur after a lengthy build process: verify that the binary used to obtain the ABI information contains the requested architectures.

Fixes: #25952

Merge request reports