cmake: tf-psa-crypto: Rename mbedtls_test to tf_psa_crypto_test

To avoid conflict between the two targets when
the integration of the TF-PSA-Crypto cmake build
system into the Mbed TLS one is completed.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2024-10-07 09:58:57 +02:00
parent a9219ff73d
commit 2609fe9155
2 changed files with 12 additions and 12 deletions

View File

@ -342,16 +342,16 @@ add_subdirectory(pkgconfig)
# library and that there is as of today no portable way of handling such # library and that there is as of today no portable way of handling such
# dependencies (only toolchain specific solutions). # dependencies (only toolchain specific solutions).
# #
# Thus the below definition of the `mbedtls_test` CMake library of objects # Thus the below definition of the `tf_psa_crypto_test` CMake library of
# target. This library of objects is used by tests and programs CMake files # objects target. This library of objects is used by tests and programs CMake
# to define the test executables. # files to define the test executables.
# #
if(ENABLE_TESTING OR ENABLE_PROGRAMS) if(ENABLE_TESTING OR ENABLE_PROGRAMS)
file(GLOB MBEDTLS_TEST_FILES file(GLOB MBEDTLS_TEST_FILES
${MBEDTLS_DIR}/tests/src/*.c ${MBEDTLS_DIR}/tests/src/*.c
${MBEDTLS_DIR}/tests/src/drivers/*.c) ${MBEDTLS_DIR}/tests/src/drivers/*.c)
add_library(mbedtls_test OBJECT ${MBEDTLS_TEST_FILES}) add_library(tf_psa_crypto_test OBJECT ${MBEDTLS_TEST_FILES})
set_base_compile_options(mbedtls_test) set_base_compile_options(tf_psa_crypto_test)
if(GEN_FILES) if(GEN_FILES)
add_custom_command( add_custom_command(
OUTPUT OUTPUT
@ -366,7 +366,7 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
DEPENDS DEPENDS
${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_keys.py ${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_keys.py
) )
add_custom_target(test_keys_header DEPENDS ${MBEDTLS_DIR}/tests/src/test_keys.h) add_custom_target(tf_psa_crypto_test_keys_header DEPENDS ${MBEDTLS_DIR}/tests/src/test_keys.h)
add_custom_command( add_custom_command(
OUTPUT OUTPUT
@ -381,10 +381,10 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
DEPENDS DEPENDS
${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_cert_macros.py ${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_cert_macros.py
) )
add_custom_target(test_certs_header DEPENDS ${MBEDTLS_DIR}/tests/src/test_certs.h) add_custom_target(tf_psa_crypto_test_certs_header DEPENDS ${MBEDTLS_DIR}/tests/src/test_certs.h)
add_dependencies(mbedtls_test test_keys_header test_certs_header) add_dependencies(tf_psa_crypto_test tf_psa_crypto_test_keys_header tf_psa_crypto_test_certs_header)
endif() endif()
target_include_directories(mbedtls_test target_include_directories(tf_psa_crypto_test
PRIVATE ${MBEDTLS_DIR}/tests/include PRIVATE ${MBEDTLS_DIR}/tests/include
PRIVATE ${MBEDTLS_DIR}/include PRIVATE ${MBEDTLS_DIR}/include
PRIVATE include PRIVATE include
@ -392,8 +392,8 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
PRIVATE core PRIVATE core
PRIVATE drivers/builtin/src) PRIVATE drivers/builtin/src)
# Request C11, needed for memory poisoning tests # Request C11, needed for memory poisoning tests
set_target_properties(mbedtls_test PROPERTIES C_STANDARD 11) set_target_properties(tf_psa_crypto_test PROPERTIES C_STANDARD 11)
set_config_files_compile_definitions(mbedtls_test) set_config_files_compile_definitions(tf_psa_crypto_test)
endif() endif()
if(ENABLE_PROGRAMS) if(ENABLE_PROGRAMS)

View File

@ -293,7 +293,7 @@ function(add_test_suite suite_name)
) )
add_executable(test_suite_${data_name} test_suite_${data_name}.c add_executable(test_suite_${data_name} test_suite_${data_name}.c
$<TARGET_OBJECTS:mbedtls_test>) $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(test_suite_${data_name}) set_base_compile_options(test_suite_${data_name})
target_compile_options(test_suite_${data_name} PRIVATE ${TEST_C_FLAGS}) target_compile_options(test_suite_${data_name} PRIVATE ${TEST_C_FLAGS})
add_dependencies(test_suite_${data_name} ${dependency}) add_dependencies(test_suite_${data_name} ${dependency})