Skip to content

Commit fb90efe

Browse files
frkvcfriedt
authored andcommitted
modules: mbedtls: Allow custom mbedtls implementation
-The current scheme in zephyr has the two choices MBEDTLS_BUILTIN and MBEDTLS_LIBRARY, but the choice of MBEDTLS_LIBRARY requires setting CONFIG_MBEDTLS_INSTALL_PATH for includes and library linking. This may not be neccesary when an alternative implementation of the library is being used. This adds support for custom choices in MBEDTLS_IMPLEMENTATION which can be added in an out-of-tree Kconfig file. -Made else an elseif(CONFIG_MBEDTLS_LIBRARY. -Removed reduntant assertion between the two choices. Signed-off-by: Frank Audun Kvamtrø <[email protected]>
1 parent 464cd56 commit fb90efe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/mbedtls/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ if(CONFIG_ARCH_POSIX AND CONFIG_ASAN AND NOT CONFIG_64BIT)
3535
endif ()
3636

3737
zephyr_library_link_libraries(mbedTLS)
38-
else()
39-
assert(CONFIG_MBEDTLS_LIBRARY "MBEDTLS was enabled, but neither BUILTIN or LIBRARY was selected.")
38+
elseif (CONFIG_MBEDTLS_LIBRARY)
4039

4140
# NB: CONFIG_MBEDTLS_LIBRARY is not regression tested and is
4241
# therefore susceptible to bit rot
@@ -53,6 +52,11 @@ else()
5352
# Lib mbedtls_external depends on libgcc (I assume?) so to allow
5453
# mbedtls_external to link with gcc we need to ensure it is placed
5554
# after mbedtls_external on the linkers command line.
55+
else()
56+
# If none of either CONFIG_MBEDTLS_BUILTIN or CONFIG_MBEDTLS_LIBRARY
57+
# are defined the users need add a custom Kconfig choice to the
58+
# MBEDTLS_IMPLEMENTATION and manually add the mbedtls library and
59+
# included the required directories for mbedtls in their projects.
5660
endif()
5761

5862
endif()

0 commit comments

Comments
 (0)