1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-03 12:00:59 +00:00

Merge pull request #12 from dllaurence/optional-tests

Make test build optional in CMake
This commit is contained in:
Pavol Rusnak 2014-07-17 19:56:36 +02:00
commit ffd2d69dd6

View File

@ -1,18 +1,24 @@
cmake_minimum_required(VERSION 2.6) 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) 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)
# disable sequence point warnings where they are expected
set_source_files_properties(aeskey.c PROPERTIES
COMPILE_FLAGS -Wno-sequence-point)
if(MSVC) if(MSVC)
set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX) set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX)
endif(MSVC) endif(MSVC)
add_library(TrezorCrypto STATIC ${SOURCES}) add_library(TrezorCrypto STATIC ${SOURCES})
# disable sequence point warning because of AES code # Build trezor-crypto tests (requires OpenSSL)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-sequence-point") if (TREZOR_CRYPTO_TESTS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sequence-point") add_executable(tests tests.c)
add_executable(tests tests.c) target_link_libraries(tests TrezorCrypto check rt pthread m crypto)
target_link_libraries(tests TrezorCrypto check rt pthread m crypto) add_test(NAME trezor-crypto COMMAND tests)
add_test(NAME trezor-crypto COMMAND tests)
add_executable(test-openssl test-openssl.c) add_executable(test-openssl test-openssl.c)
target_link_libraries(test-openssl TrezorCrypto check rt pthread m crypto) target_link_libraries(test-openssl TrezorCrypto check rt pthread m crypto)
add_test(NAME trezor-crypto-openssl COMMAND test-openssl 100) add_test(NAME trezor-crypto-openssl COMMAND test-openssl 100)
endif()