According to the CMake docs, this is the correct way to setup a toolchain file for cross-compilation using Clang. See https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-using-clang
Internally it looks like CMake will only take this variable into account if it detects the compiler to be Clang, so this shouldn’t effect other builds, but in the case of our Apple cross builds, we’d end up with a duplicated --target=$ARCH-apple-darwin
on the compiler line, given we are already setting --target
for Darwin builds.
Would fix #31748.