Skip to content

Commit

Permalink
Use patched mbedtls
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed May 25, 2020
1 parent 3cfe49d commit 9cb53a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ if (USE_MBEDCRYPTO)
set(USE_CRYPTO_SUBMODULE ON CACHE BOOL "")
set(ENABLE_PROGRAMS OFF CACHE BOOL "")
set(ENABLE_TESTING OFF CACHE BOOL "") # disable mbedtls tests
add_subdirectory(mbedtls)
file(COPY mbedtls DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/patched)
execute_process(COMMAND patch -p1 -u
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/patched/mbedtls
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/mbedtls-ed25519.patch)
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/patched/mbedtls)
endif (USE_MBEDCRYPTO)

file(GLOB SRC src/*.c)
Expand All @@ -22,7 +26,7 @@ if (USE_MBEDCRYPTO)
target_link_libraries(canokey-crypto mbedcrypto)
endif (USE_MBEDCRYPTO)
target_include_directories(canokey-crypto PUBLIC include)
target_include_directories(canokey-crypto PRIVATE mbedtls/include)
target_include_directories(canokey-crypto PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/patched/mbedtls/include)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")

Expand Down
2 changes: 1 addition & 1 deletion mbedtls

0 comments on commit 9cb53a6

Please sign in to comment.