Ignore `CMAKE_SYSROOT` when cross-compiling (#8318)
authorAndres Noetzli <andres.noetzli@gmail.com>
Wed, 16 Mar 2022 00:10:23 +0000 (17:10 -0700)
committerGitHub <noreply@github.com>
Wed, 16 Mar 2022 00:10:23 +0000 (00:10 +0000)
commit486bd5a12ae9505ef484935abd6eae6d9b2495c2
tree1a13b3d21ab3e792ca2842c53bddfb7dbb921143
parent4128af1ac9aba2512aa339b2276c5e8fc719af45
Ignore `CMAKE_SYSROOT` when cross-compiling (#8318)

This commit changes our build system to ignore CMAKE_SYSROOT for
find_file(), find_path(), and find_library() when cross-compiling.
Previously, it could happen that, e.g., when we were cross-compiling a
static build for Windows, CMake would pick up /usr/lib/libgmp.a
instead of cross-compiling GMP. The comments in the Toolchain-*.cmake
files suggest that the new behavior was the intended behavior all along.
cmake/Toolchain-aarch64.cmake
cmake/Toolchain-mingw64.cmake