diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2023-03-23 14:29:06 +0100 |
---|---|---|
committer | Martin Michlmayr <tbm@cyrius.com> | 2023-03-24 14:29:57 +0800 |
commit | 70240b4cdb8b8261879bfd70e60c7b64f1124004 (patch) | |
tree | 08147174c26ca4e278e3a5a6617d895a5ca4f040 | |
parent | eb01dafe2108d9ce22a810a26b8fdd625a440a49 (diff) | |
download | fork-ledger-70240b4cdb8b8261879bfd70e60c7b64f1124004.tar.gz fork-ledger-70240b4cdb8b8261879bfd70e60c7b64f1124004.tar.bz2 fork-ledger-70240b4cdb8b8261879bfd70e60c7b64f1124004.zip |
Bump required Gmp version to 6.1.2
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | README.md | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f6892a59..2592259e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ set(Required_CMake_Version 3.16.2) set(Required_Boost_Version 1.72) +set(Required_Gmp_Version 6.1.2) set(Required_Python_Version 3.9) set(Required_Gpgmepp_Version 1.13.1) @@ -218,6 +219,18 @@ macro(find_req_library_and_header _header_var _header _lib_var _lib) endmacro(find_req_library_and_header _header_var _header _lib_var _lib) find_req_library_and_header(GMP_PATH gmp.h GMP_LIB gmp) +if (GMP_PATH AND EXISTS "${GMP_PATH}/gmp.h") + file(STRINGS "${GMP_PATH}/gmp.h" gmp_header_str REGEX "^#define[\t ]+__GNU_MP_VERSION(_MINOR|_PATCHLEVEL)?[\t ]+[0-9]+") + string(REGEX REPLACE ".*#define __GNU_MP_VERSION[\t ]+([0-9]+).*" "\\1" GMP_VERSION_MAJOR "${gmp_header_str}") + string(REGEX REPLACE ".*#define __GNU_MP_VERSION_MINOR[\t ]+([0-9]+).*" "\\1" GMP_VERSION_MINOR "${gmp_header_str}") + string(REGEX REPLACE ".*#define __GNU_MP_VERSION_PATCHLEVEL[\t ]+([0-9]+).*" "\\1" GMP_VERSION_PATCH "${gmp_header_str}") + unset(gmp_header_str) + set(GMP_VERSION_STRING "${GMP_VERSION_MAJOR}.${GMP_VERSION_MINOR}.${GMP_VERSION_PATCH}") + if ("${GMP_VERSION_STRING}" VERSION_LESS ${Required_Gmp_Version}) + message(FATAL_ERROR "Ledger requires GMP version ${Expected_Gmp_Version} or greater, but only GMP version ${GMP_VERSION_STRING} was found") + endif() +endif() + find_req_library_and_header(MPFR_PATH mpfr.h MPFR_LIB mpfr) check_library_exists(edit readline "" HAVE_EDIT) @@ -62,7 +62,7 @@ Dependency | Version (or greater) ------------|--------------------- [CMake] | 3.16.2 [Boost] | 1.72 -[GMP] | 4.2.2 +[Gmp] | 6.1.2 [MPFR] | 2.4.0 [utfcpp] | 3.2.3 [gettext] | 0.17 _optional_ |