Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/CMakeLists.txt
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
check_type_size(__int128 SIZEOF___INT128) | check_type_size(__int128 SIZEOF___INT128) | ||||
if(SIZEOF___INT128 EQUAL 16) | if(SIZEOF___INT128 EQUAL 16) | ||||
set(HAVE___INT128 1) | set(HAVE___INT128 1) | ||||
else() | else() | ||||
# If we do not support __int128, we should be falling back | # If we do not support __int128, we should be falling back | ||||
# on 32bits implementations for field and scalar. | # on 32bits implementations for field and scalar. | ||||
endif() | endif() | ||||
# Detect if we are on a 32 or 64 bits plateform and chose | # Detect if we are on a 32 or 64 bits platform and chose | ||||
# scalar and filed implementation accordingly | # scalar and field implementation accordingly. | ||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||||
# 64 bits implementationr require either __int128 or asm support. | # 64 bits implementation require either __int128 or asm support. | ||||
if (HAVE___INT128 OR USE_ASM_X86_64) | if (HAVE___INT128 OR USE_ASM_X86_64) | ||||
set(USE_SCALAR_4X64 1) | set(USE_SCALAR_4X64 1) | ||||
set(USE_FIELD_5X52 1) | set(USE_FIELD_5X52 1) | ||||
else() | else() | ||||
message(SEND_ERROR "Compiler does not support __int128 or insline assembly") | message(SEND_ERROR "Compiler does not support __int128 or inline assembly") | ||||
endif() | endif() | ||||
else() | else() | ||||
set(USE_SCALAR_8X32 1) | set(USE_SCALAR_8X32 1) | ||||
set(USE_FIELD_10X26 1) | set(USE_FIELD_10X26 1) | ||||
endif() | endif() | ||||
# Executable internal to secp256k1 need to have the HAVE_CONFIG_H define set. | # Executable internal to secp256k1 need to have the HAVE_CONFIG_H define set. | ||||
# For convenience, we wrap this into a function. | # For convenience, we wrap this into a function. | ||||
Show All 33 Lines | |||||
endif() | endif() | ||||
# Schnorr module | # Schnorr module | ||||
option(SECP256K1_ENABLE_MODULE_SCHNORR "Build libsecp256k1's Schnorr module" ON) | option(SECP256K1_ENABLE_MODULE_SCHNORR "Build libsecp256k1's Schnorr module" ON) | ||||
if(SECP256K1_ENABLE_MODULE_SCHNORR) | if(SECP256K1_ENABLE_MODULE_SCHNORR) | ||||
set(ENABLE_MODULE_SCHNORR 1) | set(ENABLE_MODULE_SCHNORR 1) | ||||
endif() | endif() | ||||
# Static precomputation for eliptic curve mutliplication | # Static precomputation for elliptic curve multiplication | ||||
option(SECP256K1_ECMULT_STATIC_PRECOMPUTATION "Precompute libsecp256k1's eliptic curve mutliplication tables" ON) | option(SECP256K1_ECMULT_STATIC_PRECOMPUTATION "Precompute libsecp256k1's elliptic curve multiplication tables" ON) | ||||
if(SECP256K1_ECMULT_STATIC_PRECOMPUTATION) | if(SECP256K1_ECMULT_STATIC_PRECOMPUTATION) | ||||
set(USE_ECMULT_STATIC_PRECOMPUTATION 1) | set(USE_ECMULT_STATIC_PRECOMPUTATION 1) | ||||
include(NativeExecutable) | include(NativeExecutable) | ||||
add_native_executable(gen_context src/gen_context.c) | add_native_executable(gen_context src/gen_context.c) | ||||
add_custom_command( | add_custom_command( | ||||
OUTPUT ecmult_static_context.h | OUTPUT ecmult_static_context.h | ||||
Show All 34 Lines |