Skip to content

Commit 57e23b2

Browse files
committed
nrf_security: remove mbedcrypto_base CMake library
It seemed to just be a sort of duplicate/extension of mbedcrypto without added benefit. Remove it, merging it into mbedcrypto. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
1 parent c83d64c commit 57e23b2

4 files changed

Lines changed: 9 additions & 34 deletions

File tree

subsys/nrf_security/src/CMakeLists.txt

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ add_library(${mbedcrypto_target}
9696
)
9797

9898
target_link_libraries(${mbedcrypto_target}
99-
INTERFACE
99+
PUBLIC
100100
psa_crypto_config_chosen
101101
psa_interface
102+
PRIVATE
103+
$<TARGET_NAME_IF_EXISTS:platform_s>
104+
nrf_security_utils
102105
)
103106

104107
if(CONFIG_PSA_SSF_CRYPTO_CLIENT)
@@ -135,23 +138,11 @@ endif()
135138
include(${CMAKE_CURRENT_LIST_DIR}/threading/threading.cmake)
136139
include(${NRF_SECURITY_DIR}/src/utils/nrf_security_utils.cmake)
137140

138-
# Add base library with files required by all drivers/backends.
139-
add_library(mbedcrypto_base
140-
STATIC
141-
${src_crypto_base}
142-
)
143-
144-
target_link_libraries(mbedcrypto_base
141+
target_sources(${mbedcrypto_target}
145142
PRIVATE
146-
psa_crypto_config_chosen
147-
$<TARGET_NAME_IF_EXISTS:platform_s>
148-
nrf_security_utils
149-
PUBLIC
150-
psa_interface
143+
${src_crypto_base}
151144
)
152145

153-
nrf_security_add_zephyr_options(mbedcrypto_base)
154-
155146
# Misusing the psa_crypto_config and psa_crypto_library_config awareness to
156147
# set compiler-flags to ensure right floating-point types are set
157148
if(COMPILER_CP_FLAG)
@@ -180,11 +171,6 @@ if(LINKER_CP_OPTION)
180171
)
181172
endif()
182173

183-
target_link_libraries(${mbedcrypto_target}
184-
PRIVATE
185-
mbedcrypto_base
186-
)
187-
188174
# Add PSA core
189175
if(CONFIG_MBEDTLS_PSA_CRYPTO_C)
190176
add_subdirectory(core)
@@ -198,17 +184,9 @@ if(CONFIG_MBEDTLS_LEGACY_CRYPTO_C OR (CONFIG_NRF_OBERON AND CONFIG_BUILD_WITH_TF
198184
add_subdirectory(legacy)
199185
endif()
200186

201-
# In TF-M build, a psa_interface lib is created and we must inherit its settings
202-
set_property(TARGET ${mbedcrypto_target}
203-
APPEND PROPERTY
204-
PRIVATE_LINK_LIBRARIES
205-
$<TARGET_NAME_IF_EXISTS:psa_interface>
206-
)
207-
208187
# NEWLIB requires linking with the C library
209188
if(CONFIG_NEWLIB_LIBC)
210189
target_link_libraries(${mbedcrypto_target} PRIVATE -lc)
211-
target_link_libraries(mbedcrypto_base PRIVATE -lc)
212190
endif()
213191

214192
if(CONFIG_MBEDTLS_X509_LIBRARY)
@@ -233,7 +211,6 @@ if(CONFIG_MBEDTLS_X509_LIBRARY)
233211
PRIVATE
234212
psa_crypto_config_chosen
235213
${mbedcrypto_target}
236-
mbedcrypto_base
237214
)
238215

239216
nrf_security_add_zephyr_options(mbedx509)
@@ -276,7 +253,6 @@ if(CONFIG_MBEDTLS_TLS_LIBRARY)
276253
psa_crypto_config_chosen
277254
mbedx509
278255
${mbedcrypto_target}
279-
mbedcrypto_base
280256
)
281257

282258
nrf_security_add_zephyr_options(mbedtls)

subsys/nrf_security/src/core/nrf_oberon/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ target_compile_definitions(psa_core
4747
target_link_libraries(psa_core
4848
PRIVATE
4949
psa_crypto_library_config
50-
mbedcrypto_base
50+
psa_interface
5151
nrf_security_utils
5252
)
5353

subsys/nrf_security/src/drivers/cracen/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ target_link_libraries(cracen_psa_driver
4646
PRIVATE
4747
psa_crypto_library_config
4848
psa_interface
49-
mbedcrypto_base
5049
nrf_security_utils
5150
)
5251

subsys/nrf_security/src/legacy/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ if(DEFINED src_crypto_legacy)
111111
endif()
112112

113113
if(DEFINED src_crypto_legacy_base)
114-
target_sources(mbedcrypto_base
114+
target_sources(${mbedcrypto_target}
115115
PRIVATE
116116
${src_crypto_legacy_base}
117117
)
@@ -141,7 +141,7 @@ if(CONFIG_MBEDTLS_LEGACY_CRYPTO_C AND CONFIG_CC3XX_BACKEND)
141141
endif()
142142

143143
if(TARGET nrf_cc3xx_core_imported)
144-
# nrf_cc3xx needs functionality from mbedcrypto_base
144+
# nrf_cc3xx needs functionality from mbedcrypto
145145
target_link_libraries(nrf_cc3xx_core_imported
146146
INTERFACE
147147
psa_crypto_config_chosen

0 commit comments

Comments
 (0)