Ignore `CMAKE_SYSROOT` when cross-compiling (#8318)