cmake: Move cert.o to mbedtls_test_helpers library of objects

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2024-11-22 19:09:27 +01:00
parent 80963c64eb
commit d5331ff4e6
4 changed files with 13 additions and 5 deletions

View File

@ -413,6 +413,7 @@ add_subdirectory(pkgconfig)
#
if(ENABLE_TESTING OR ENABLE_PROGRAMS)
file(GLOB MBEDTLS_TEST_HELPER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/tests/src/*.c
${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_helpers/*.c)
add_library(mbedtls_test_helpers OBJECT ${MBEDTLS_TEST_HELPER_FILES})
set_base_compile_options(mbedtls_test_helpers)

View File

@ -28,7 +28,10 @@ add_dependencies(${programs_target} ${executables_with_common_c})
foreach(exe IN LISTS executables_no_common_c executables_with_common_c)
set(exe_sources ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set(exe_sources
${exe}.c
$<TARGET_OBJECTS:mbedtls_test_helpers>
$<TARGET_OBJECTS:tf_psa_crypto_test>)
if(NOT FUZZINGENGINE_LIB)
list(APPEND exe_sources onefile.c)
endif()

View File

@ -38,7 +38,10 @@ foreach(exe IN LISTS executables)
${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.h
${CMAKE_CURRENT_BINARY_DIR}/../test/query_config.c)
endif()
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>
add_executable(${exe}
${exe}.c
$<TARGET_OBJECTS:mbedtls_test_helpers>
$<TARGET_OBJECTS:tf_psa_crypto_test>
${extra_sources})
set_base_compile_options(${exe})
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
@ -54,7 +57,10 @@ foreach(exe IN LISTS executables)
endforeach()
if(THREADS_FOUND)
add_executable(ssl_pthread_server ssl_pthread_server.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
add_executable(ssl_pthread_server
ssl_pthread_server.c
$<TARGET_OBJECTS:mbedtls_test_helpers>
$<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(ssl_pthread_server)
target_include_directories(ssl_pthread_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../framework/tests/include
${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)

View File

@ -403,7 +403,6 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
file(GLOB MBEDTLS_TEST_FILES
${MBEDTLS_FRAMEWORK_DIR}/tests/src/*.c
${MBEDTLS_FRAMEWORK_DIR}/tests/src/drivers/*.c
${MBEDTLS_DIR}/tests/src/*.c
${TF_PSA_CRYPTO_DIR}/tests/src/*.c)
add_library(tf_psa_crypto_test OBJECT ${MBEDTLS_TEST_FILES})
set_base_compile_options(tf_psa_crypto_test)
@ -427,7 +426,6 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
endif()
target_include_directories(tf_psa_crypto_test
PRIVATE ${MBEDTLS_FRAMEWORK_DIR}/tests/include
PRIVATE ${MBEDTLS_DIR}/tests/include
PRIVATE ${TF_PSA_CRYPTO_DIR}/tests/include
PRIVATE ${MBEDTLS_DIR}/include
PRIVATE include