-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
47 lines (40 loc) · 1.29 KB
/
CMakeLists.txt
File metadata and controls
47 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.16)
project(mpt-crypto C CXX)
# --- Find Dependencies ---
find_package(OpenSSL REQUIRED)
find_package(secp256k1 REQUIRED)
# --- Define The Library ---
add_library(
mpt-crypto
src/bulletproof_aggregated.c
src/commitments.c
src/elgamal.c
src/equality_proof.c
src/mpt_scalar.c
src/proof_link.c
src/proof_pok_sk.c
src/proof_same_plaintext.c
src/proof_same_plaintext_multi.c
src/proof_same_plaintext_multi_shared_r.c
)
# --- Set Include Directories ---
target_include_directories(mpt-crypto PUBLIC include)
# --- Set Compile Definitions ---
include(CheckTypeSize)
# Check if the compiler supports __int128 (required for the optimized 64-bit code)
check_type_size("__int128" HAVE___INT128)
if(HAVE___INT128)
message(STATUS "Build: Detected 128-bit integer support.")
target_compile_definitions(mpt-crypto PRIVATE SECP256K1_WIDEMUL_INT128)
else()
message(STATUS "Build: No 128-bit support detected.")
target_compile_definitions(mpt-crypto PRIVATE SECP256K1_WIDEMUL_INT64)
endif()
# --- Link Dependencies ---
target_link_libraries(mpt-crypto PUBLIC secp256k1::secp256k1 OpenSSL::Crypto)
# --- Testing ---
option(ENABLE_TESTS "Enable building tests" ON)
if(ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
endif()