On Linux:
mkdir buildcmake && cd buildcmake
The default check-all behavior is unaffected:
cmake -GNinja ..
ninja check-all
Check in the output that the java tests are not run.
ls ./src/secp256k1 | grep ".so" # Should return nothing
JNI requires the ECDH module:
rm -rf *
rm -rf *
Should return a CMake error:
```
The secp256k1 JNI support requires ECDH. Try again with
-DSECP256K1_ENABLE_MODULE_ECDH=ON.
```
The check-all target runs the java tests when JNI is enabled:
rm -rf *
cmake -GNinja .. -DSECP256K1_ENABLE_JNI=ON \
-DSECP256K1_ENABLE_MODULE_ECDH=ON
ninja check-all
Check in the output that the java tests are run.
ls ./src/secp256k1 | grep ".so" # Should return libsecp256k1.so
It also works when built as standalone:
cd ../src/secp256k1
mkdir buildcmake && cd buildcmake
cmake -GNinja .. -DSECP256K1_ENABLE_JNI=ON \
-DSECP256K1_ENABLE_MODULE_ECDH=ON
ninja secp256k1-check-java
Check in the output that the java tests are run.
ls . | grep ".so" # Should return libsecp256k1.so