Skip to content

Commit

Permalink
[#239] Custom Crypto Module - CMake updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbrown2 committed May 2, 2024
1 parent 7263751 commit 510e9dc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ project(crypto C)
set(SA_CUSTOM_PATH_DEFAULT "../../sa/custom")
set(KEY_CUSTOM_PATH_DEFAULT "../../key/custom")
set(MC_CUSTOM_PATH_DEFAULT "../../mc/custom")
set(CRYPTO_CUSTOM_PATH_DEFAULT "../../crypto/custom")



Expand All @@ -36,6 +37,8 @@ option(CODECOV "Code Coverage" OFF)
option(CRYPTO_LIBGCRYPT "Cryptography Module - Libgcrypt" ON)
option(CRYPTO_KMC "Cryptography Module - KMC" OFF)
option(CRYPTO_WOLFSSL "Cryptography Module - WolfSSL" OFF)
option(CRYPTO_CUSTOM "Cryptography Module - CUSTOM" OFF)
option(CRYPTO_CUSTOM_PATH "Cryptography Module - CUSTOM PATH" OFF)
option(DEBUG "Debug" OFF)
option(KEY_CUSTOM "Key Module - Custom" OFF)
option(KEY_CUSTOM_PATH "Custom Key Path" OFF)
Expand Down Expand Up @@ -83,6 +86,13 @@ if(SA_CUSTOM)
message(STATUS "SA_CUSTOM being utilized. Path set to: ${SA_CUSTOM_PATH}")
endif()

if(CRYPTO_CUSTOM)
if(NOT DEFINED ${CRYPTO_CUSTOM_PATH})
set(CRYPTO_CUSTOM_PATH ${CRYPTO_CUSTOM_PATH_DEFAULT})
endif()
message(STATUS "CRYPTO_CUSTOM being utilized. Path set to: ${CRYPTO_CUSTOM_PATH}")
endif()


#
# Build Flag Logic
Expand Down
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ include_directories(../include)

aux_source_directory(core LIB_SRC_FILES)

if(CRYPTO_CUSTOM)
aux_source_directory(CRYPTO_CUSTOM_PATH CRYPTO_FILES)
list(APPEND LIB_SRC_FILES ${CRYPTO_FILES})
else()
aux_source_directory(crypto/custom_stub CRYPTO_FILES)
list(APPEND LIB_SRC_FILES ${CRYPTO_FILES})
endif()

if(CRYPTO_LIBGCRYPT)
aux_source_directory(crypto/libgcrypt LIBGCRYPT_FILES)
list(APPEND LIB_SRC_FILES ${LIBGCRYPT_FILES})
Expand Down

0 comments on commit 510e9dc

Please sign in to comment.