Page MenuHomePhabricator

[CMAKE] Allow for building static and shared versions of secp256k1
Needs ReviewPublic

Authored by Fabien on Wed, Aug 14, 11:58.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

The previous behavior generated a static library by default, and allowed
for building a shared library by setting -DBUILD_SHARED_LIBS=ON on the
cmake command line when building secp256k1 standalone.
It was not possible to build both a static and a shared library at the
same time, which would unfortunately prevent running the secp256k1 Java
tests as part of the check-all target, because these tests require a
shared secp256k1 library.

This diff is a first step toward building the JNI binding and running
the Java tests. It still defaults to building a static secp256k1 library
and add an option (SECP256K1_BUILD_SHARED) for building the shared
version also.

Test Plan
mkdir buildcmake && cd buildcmake
cmake -GNinja .. -DSECP256K1_BUILD_SHARED=ON
ninja
ninja check-all
ninja bench-secp256k1

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_secp256k1_object_lib
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7141
Build 12327: Bitcoin ABC Teamcity Staging
Build 12326: arc lint + arc unit