From d29cbda09cb7bd7d70e2f78b6c55b68b5e6c3cea Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 22 Mar 2021 17:44:41 +0100 Subject: [PATCH] CGAL stack compiles --- deps/GMP/GMP.cmake | 8 +++++++- deps/MPFR/MPFR.cmake | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/deps/GMP/GMP.cmake b/deps/GMP/GMP.cmake index a7fe19355..4b965ae13 100644 --- a/deps/GMP/GMP.cmake +++ b/deps/GMP/GMP.cmake @@ -36,11 +36,17 @@ else () set(_gmp_build_tgt "") # let it guess endif() + set(_cross_compile_arg "") + if (CMAKE_CROSSCOMPILING) + # TOOLCHAIN_PREFIX should be defined in the toolchain file + set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX}) + endif () + ExternalProject_Add(dep_GMP # URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 URL https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2 BUILD_IN_SOURCE ON - CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt} + CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt} BUILD_COMMAND make -j INSTALL_COMMAND make install ) diff --git a/deps/MPFR/MPFR.cmake b/deps/MPFR/MPFR.cmake index ddbb178d8..a4e30e645 100644 --- a/deps/MPFR/MPFR.cmake +++ b/deps/MPFR/MPFR.cmake @@ -18,10 +18,17 @@ if (MSVC) add_custom_target(dep_MPFR SOURCES ${_output}) else () + + set(_cross_compile_arg "") + if (CMAKE_CROSSCOMPILING) + # TOOLCHAIN_PREFIX should be defined in the toolchain file + set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX}) + endif () + ExternalProject_Add(dep_MPFR URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed BUILD_IN_SOURCE ON - CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt} + CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt} BUILD_COMMAND make -j INSTALL_COMMAND make install DEPENDS dep_GMP