forked from OffchainLabs/arbitrum-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add libff and secp256k1 to arb-avm-cpp compilation
- Loading branch information
Showing
5 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
include(ExternalProject) | ||
ExternalProject_Add(secp256k1_ext | ||
GIT_REPOSITORY "https://github.com/bitcoin-core/secp256k1.git" | ||
GIT_TAG "master" | ||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/secp256k1" | ||
CONFIGURE_COMMAND ./autogen.sh COMMAND <SOURCE_DIR>/configure --enable-module-recovery --prefix <INSTALL_DIR> | ||
BUILD_COMMAND make | ||
UPDATE_COMMAND "" | ||
BUILD_IN_SOURCE 1 | ||
) | ||
|
||
add_library(secp256k1 IMPORTED STATIC GLOBAL) | ||
add_dependencies (secp256k1 secp256k1_ext) | ||
ExternalProject_Get_Property(secp256k1_ext install_dir) | ||
|
||
file(MAKE_DIRECTORY ${install_dir}/include) | ||
|
||
set_target_properties(secp256k1 PROPERTIES | ||
"IMPORTED_LOCATION" "${install_dir}/lib/libsecp256k1.a" | ||
"INTERFACE_INCLUDE_DIRECTORIES" "${install_dir}/include" | ||
|
||
) | ||
|
||
ExternalProject_Add(libff_ext | ||
GIT_REPOSITORY "https://github.com/scipr-lab/libff" | ||
GIT_TAG "master" | ||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libff" | ||
CMAKE_ARGS -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} | ||
-DOPENSSL_INCLUDE_DIR=${OPENSSL_ROOT_DIR}/include | ||
-DWITH_PROCPS=OFF | ||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||
) | ||
|
||
add_library(libff IMPORTED STATIC GLOBAL) | ||
add_dependencies (libff libff_ext) | ||
ExternalProject_Get_Property(libff_ext install_dir) | ||
|
||
file(MAKE_DIRECTORY ${install_dir}/include) | ||
|
||
set_target_properties(libff PROPERTIES | ||
"IMPORTED_LOCATION" "${install_dir}/lib/libff.a" | ||
"INTERFACE_INCLUDE_DIRECTORIES" "${install_dir}/include" | ||
|
||
) |