From 9a191a3fae2abfc68be734ca5790024fea93e9f1 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Wed, 11 May 2022 11:13:31 -0700 Subject: [PATCH] Remove --build from GMP configure line (#8752) This is an attempt to fix the pypi build. --- cmake/FindGMP.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/FindGMP.cmake b/cmake/FindGMP.cmake index 38771692a..481bd973a 100644 --- a/cmake/FindGMP.cmake +++ b/cmake/FindGMP.cmake @@ -65,6 +65,11 @@ if(NOT GMP_FOUND_SYSTEM) set(GMP_LIBRARIES "${DEPS_BASE}/lib/libgmp.a") endif() + set(CONFIGURE_OPTS "") + if(CMAKE_CROSSCOMPILING) + set(CONFIGURE_OPTS --host=${TOOLCHAIN_PREFIX} --build=${CMAKE_HOST_SYSTEM_PROCESSOR}) + endif() + # `CC_FOR_BUILD`, `--host`, and `--build` are passed to `configure` to ensure # that cross-compilation works (as suggested in the GMP documentation). # Without the `--build` flag, `configure` may fail for cross-compilation @@ -81,8 +86,7 @@ if(NOT GMP_FOUND_SYSTEM) --prefix= --with-pic --enable-cxx - --host=${TOOLCHAIN_PREFIX} - --build=${CMAKE_HOST_SYSTEM_PROCESSOR} + ${CONFIGURE_OPTS} BUILD_BYPRODUCTS ${GMP_LIBRARIES} ) endif() -- 2.30.2