forked from trezor/trezor-crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
27 lines (20 loc) · 1 KB
/
CMakeLists.txt
File metadata and controls
27 lines (20 loc) · 1 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
cmake_minimum_required(VERSION 2.6)
set(SOURCES aescrypt.c aeskey.c aes_modes.c aestab.c base58.c bignum.c bip32.c bip39.c ecdsa.c hmac.c nist256p1.c pbkdf2.c rand.c ripemd160.c secp256k1.c sha2.c ed25519-donna/ed25519.c sha3.c)
include_directories(ed25519-donna)
# disable sequence point warnings where they are expected
set_source_files_properties(aeskey.c PROPERTIES
COMPILE_FLAGS -Wno-sequence-point)
set(CMAKE_C_FLAGS "-std=c99")
if(MSVC)
set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX)
endif(MSVC)
add_library(TrezorCrypto STATIC ${SOURCES})
# Build trezor-crypto tests (requires OpenSSL)
if (TREZOR_CRYPTO_TESTS)
add_executable(tests tests.c)
target_link_libraries(tests TrezorCrypto check rt pthread m crypto)
add_test(NAME trezor-crypto COMMAND tests)
add_executable(test-openssl test-openssl.c)
target_link_libraries(test-openssl TrezorCrypto check rt pthread m crypto)
add_test(NAME trezor-crypto-openssl COMMAND test-openssl 100)
endif()