Detects the host ABI of the compiler on the build machine. If you are using a cross-compiler the host ABI would be different from the target ABI.


The detection relies on probing the executable format of the compiler (ex. /usr/bin/file on Unix or DkML or Windows MSYS2, or /usr/bin/lipo -info on macOS). If that doesn't work (ex. the compiler is a script rather than an executable) then the build machine is probed.

The detection makes use of CMAKE_APPLE_SILICON_PROCESSOR if it is defined; the value must be either arm64 or x86_64.

The host ABIs are not as numerous and as hard to categorize as the target ABIs since the target may be cross-compiled.



Place the host ABI in the name result variable.

Output CACHE Variables

Sets the following CACHE variables:

  • DKML_HOST_ABI if and only if a) it has not been set and b) OUTPUT_VARIABLE was not specified