Setting CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR is often enough for CMake to handle cross-compilation even without a toolchain file, but it gets in the way of generators that handle cross-compilation on their own (in Visual Studio's case, using the -T "toolset" option).
Setting
CMAKE_SYSTEM_NAME
andCMAKE_SYSTEM_PROCESSOR
is often enough for CMake to handle cross-compilation even without a toolchain file, but it gets in the way of generators that handle cross-compilation on their own (in Visual Studio's case, using the -T "toolset" option).Narrow fix for the issue I brought up in https://github.com/rust-lang/cmake-rs/pull/158#issuecomment-1544695163. Possible fix for #171 as well, if it does turn out to be the same thing.