Skip to content

Commit

Permalink
crypto: Cleaning up dependencies for psa_crypto_config/psa_interface
Browse files Browse the repository at this point in the history
fixup! crypto: PSA core: Add psa_crypto_config and psa_crypto_library_config

(fixup of commit cbf737a)

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
  • Loading branch information
frkv authored and bjarki-andreasen committed Sep 18, 2024
1 parent 40b0682 commit ff5e58f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 0 additions & 6 deletions subsys/nrf_security/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ target_compile_definitions(psa_crypto_library_config
-DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE="${CONFIG_MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE}"
)

target_include_directories(psa_crypto_library_config
INTERFACE
${PSA_CRYPTO_CONFIG_LIBRARY_PATH}
${NRF_SECURITY_ROOT}/include
)

# Add a library for crypto includes for the PSA interface (NS, S-only and TF-M)
# The name and intent of this comes from TF-M distribution
add_library(psa_interface INTERFACE)
Expand Down
13 changes: 10 additions & 3 deletions subsys/nrf_security/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ string(REPLACE "/" "\\/" PSA_CRYPTO_CONFIG_INTERFACE_PATH_REGEX ${PSA_CRYPTO_CON
# Add include folders for psa_crypto_config (interface builds)
target_include_directories(psa_crypto_config
INTERFACE
#$<BUILD_INTERFACE:${PSA_CRYPTO_CONFIG_INTERFACE_PATH}>
${PSA_CRYPTO_CONFIG_INTERFACE_PATH}
${NRF_SECURITY_ROOT}/include
)
Expand All @@ -35,6 +34,7 @@ target_include_directories(psa_crypto_config
target_include_directories(psa_crypto_library_config
INTERFACE
${PSA_CRYPTO_CONFIG_LIBRARY_PATH}
${NRF_SECURITY_ROOT}/include
)

if(CONFIG_MBEDTLS_ENABLE_HEAP)
Expand Down Expand Up @@ -73,6 +73,12 @@ add_library(${mbedcrypto_target}
${src_crypto}
)

target_link_libraries(${mbedcrypto_target}
INTERFACE
psa_crypto_config
psa_interface
)

if(CONFIG_PSA_SSF_CRYPTO_CLIENT)
add_subdirectory(ssf_secdom)
endif()
Expand Down Expand Up @@ -114,9 +120,10 @@ add_library(mbedcrypto_base
)

target_link_libraries(mbedcrypto_base
PRIVATE
psa_crypto_config
$<TARGET_NAME_IF_EXISTS:platform_s>
PUBLIC
# Enable the PSA crypto (client) interface or the library build
$<IF:$<BOOL:${CONFIG_MBEDTLS_PSA_CRYPTO_C}>,psa_crypto_library_config,psa_crypto_config>
psa_interface
)

Expand Down

0 comments on commit ff5e58f

Please sign in to comment.