Skip to content

Commit

Permalink
Copy patched mbedtls to source dir and igore it
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed May 25, 2020
1 parent 27cd1ae commit 52680cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cmake-build-*/
build/
build/
patched/
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +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
file(COPY mbedtls DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/patched)
file(COPY mbedtls DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/patched)
execute_process(COMMAND patch -p1 -u
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/patched/mbedtls
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/patched/mbedtls
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/mbedtls-ed25519.patch)
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/patched/mbedtls)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/patched/mbedtls)
endif (USE_MBEDCRYPTO)

file(GLOB SRC src/*.c)
Expand All @@ -26,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 ${CMAKE_CURRENT_BINARY_DIR}/patched/mbedtls/include)
target_include_directories(canokey-crypto PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/patched/mbedtls/include)

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

Expand Down

0 comments on commit 52680cb

Please sign in to comment.