From 45fd0d68d9f558e43a9e95b26402d454bcb8ec6d Mon Sep 17 00:00:00 2001 From: Simon Butcher Date: Fri, 22 Nov 2019 16:51:41 +0000 Subject: [PATCH] Add USE_TINYCRYPT build option to CMake files Adds the USE_TINYCRYPT build option to the CMake build files. Default is enabled. --- CMakeLists.txt | 5 ++++- library/CMakeLists.txt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 746b38ae5..39808f9db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,7 +185,10 @@ endif(ENABLE_ZLIB_SUPPORT) add_subdirectory(library) add_subdirectory(include) -add_subdirectory(tinycrypt) + +if(USE_TINYCRYPT) + add_subdirectory(tinycrypt) +endif() if(ENABLE_PROGRAMS) add_subdirectory(programs) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 89f727524..0156856db 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,4 +1,5 @@ option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON) +option(USE_TINYCRYPT "Include TinyCrypt." ON) option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF) option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF) @@ -123,7 +124,9 @@ if(LINK_WITH_PTHREAD) set(libs ${libs} pthread) endif() -set(libs ${libs} tinycrypt) +if(USE_TINYCRYPT) + set(libs ${libs} tinycrypt) +endif() if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) message(FATAL_ERROR "Need to choose static or shared mbedtls build!")