herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 152 forks source link

Fix java-ffi CMakeLists when GMP is installed on the system #135

Closed WorldofJARcraft closed 2 years ago

WorldofJARcraft commented 2 years ago

I have realized that the CMakeLists.txt always assumes that mcl was compiled without GMP and uses the defines for VINT.
This leads to ugly run-time errors when the library tries to init mcl with VINT, but should really use the GMP-specific methods.
This PR should fix it.
Tested on Ubuntu 20.04LTS GNU/Linux with GMP and Windows 10 without GMP.

herumi commented 2 years ago

Thank you for the patch. C-APIs do not affect the presence or absence of GMP, but Java is via C++, so separation is difficult.