-
Notifications
You must be signed in to change notification settings - Fork 96
Enable use of Mbed TLS and Mbed Crypto as a CMake subproject #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ae1b548
to
3a36c5a
Compare
3a36c5a
to
6fd4022
Compare
Rebased to add MBEDTLS_DIR setting to library/CMakeLists.txt, as that's how Mbed TLS includes Mbed Crypto. |
6fd4022
to
5d5cdc5
Compare
Rebased to enable use of tests CMakeList.txt without crypto/CMakeLists.txt being included. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. I reviewed an analogous patch for Mbed TLS itself (Mbed-TLS/mbedtls#2706) and I quite liked the fact that that patch had tests. Why is it that we do not have one here? Is this pointless? Is it possible add the test?
It's not pointless. We get similar coverage from our CI system, since we build Mbed Crypto as a submodule of Mbed TLS. However, we can add an explicit test to build a program with Mbed Crypto as a standalone library via a CMake subfolder. I've added a commit to do this. |
Rebased to add a regression test and to change the minimum CMake version to 2.6, to match the version required by the top level project |
@Patater: Thanks for adding the test. I will wait for your answer regarding the test in Mbed-TLS/mbedtls#2706 (comment) before approving your changes. |
95df979
to
ffe10a8
Compare
Rebased to move cleanup of the CMake subproject test to |
Remove use of CMAKE_SOURCE_DIR in case mbedtls is built from within another CMake project. Define MBEDTLS_DIR to ${CMAKE_CURRENT_SOURCE_DIR} in the main CMakeLists.txt file and refer to that when defining target include paths to enable mbedtls to be built as a sub project. Fixes Mbed-TLS/mbedtls#2609 Signed-off-by: Ashley Duncan <[email protected]> Signed-off-by: Jaeden Amero <[email protected]>
When building Mbed Crypto when including it via CMake's `add_subdirectory()`, the tests are also built by default. This means all headers the tests need must be public, in order for the build of the tests to have access to the headers.
If we have a regression with the "build Mbed Crypto as a subdirectory with CMake" feature and fail to build, fail the test.
ffe10a8
to
e8451f2
Compare
Rebased to update to latest |
Update Mbed Crypto to a commit on its development branch that contains the merged [mbed-crypto#152 PR](ARMmbed/mbed-crypto#152).
Test psa_constant_names
Update Mbed Crypto to a commit on its development branch that contains the merged [mbed-crypto#152 PR](ARMmbed/mbed-crypto#152).
Update Mbed Crypto to a commit on its development branch that contains the merged [mbed-crypto#152 PR](ARMmbed/mbed-crypto#152).
Remove use of CMAKE_SOURCE_DIR in case mbedtls is built from within
another CMake project. Define MBEDTLS_DIR to ${CMAKE_CURRENT_SOURCE_DIR}
in the main CMakeLists.txt file and refer to that when defining target
include paths to enable mbedtls to be built as a sub project.
Fixes Mbed-TLS/mbedtls#2609
Signed-off-by: Ashley Duncan [email protected]
Signed-off-by: Jaeden Amero [email protected]