2014-07-17 14:59:14 +00:00
|
|
|
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 pbkdf2.c rand.c ripemd160.c secp256k1.c sha2.c)
|
2014-07-17 17:51:00 +00:00
|
|
|
|
|
|
|
# disable sequence point warnings where they are expected
|
|
|
|
set_source_files_properties(aeskey.c PROPERTIES
|
|
|
|
COMPILE_FLAGS -Wno-sequence-point)
|
|
|
|
|
2014-02-17 17:48:57 +00:00
|
|
|
if(MSVC)
|
|
|
|
set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX)
|
|
|
|
endif(MSVC)
|
2014-07-17 17:51:00 +00:00
|
|
|
|
2014-02-17 17:48:57 +00:00
|
|
|
add_library(TrezorCrypto STATIC ${SOURCES})
|
2014-07-16 18:39:02 +00:00
|
|
|
|
2014-07-17 17:51:00 +00:00
|
|
|
# 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)
|
2014-07-16 18:39:02 +00:00
|
|
|
|
2014-07-17 17:51:00 +00:00
|
|
|
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()
|