mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-09 11:14:26 +02:00
cmake: GNU GCC: Set base compile options target by target
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@@ -5,6 +5,7 @@ add_dependencies(${programs_target} ${executables})
|
||||
|
||||
foreach(exe IN LISTS executables)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
@@ -5,6 +5,7 @@ add_dependencies(${programs_target} ${executables})
|
||||
|
||||
foreach(exe IN LISTS executables)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
@@ -40,6 +40,7 @@ foreach(exe IN LISTS executables_no_common_c executables_with_common_c)
|
||||
endif()
|
||||
|
||||
add_executable(${exe} ${exe_sources})
|
||||
set_base_compile_options(${exe})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
|
||||
if (NOT FUZZINGENGINE_LIB)
|
||||
|
||||
@@ -7,6 +7,7 @@ add_dependencies(${programs_target} ${executables})
|
||||
|
||||
foreach(exe IN LISTS executables)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
@@ -6,6 +6,7 @@ add_dependencies(${programs_target} ${executables_mbedtls})
|
||||
|
||||
foreach(exe IN LISTS executables_mbedtls)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${mbedtls_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
@@ -34,6 +35,7 @@ add_dependencies(${programs_target} ${executables_mbedcrypto})
|
||||
|
||||
foreach(exe IN LISTS executables_mbedcrypto)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
@@ -29,6 +29,7 @@ endif()
|
||||
|
||||
foreach(exe IN LISTS executables)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
@@ -6,6 +6,7 @@ add_dependencies(${programs_target} ${executables})
|
||||
|
||||
foreach(exe IN LISTS executables)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
@@ -40,6 +40,7 @@ foreach(exe IN LISTS executables)
|
||||
endif()
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>
|
||||
${extra_sources})
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
if(exe STREQUAL "ssl_client2" OR exe STREQUAL "ssl_server2")
|
||||
@@ -53,6 +54,7 @@ endforeach()
|
||||
|
||||
if(THREADS_FOUND)
|
||||
add_executable(ssl_pthread_server ssl_pthread_server.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(ssl_pthread_server)
|
||||
target_include_directories(ssl_pthread_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||
list(APPEND executables ssl_pthread_server)
|
||||
|
||||
@@ -29,6 +29,7 @@ if(TEST_CPP)
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
)
|
||||
add_executable(cpp_dummy_build "${cpp_dummy_build_cpp}")
|
||||
set_base_compile_options(cpp_dummy_build)
|
||||
target_include_directories(cpp_dummy_build
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/include
|
||||
@@ -39,6 +40,7 @@ endif()
|
||||
if(USE_SHARED_MBEDTLS_LIBRARY AND
|
||||
NOT ${CMAKE_SYSTEM_NAME} MATCHES "[Ww][Ii][Nn]")
|
||||
add_executable(dlopen "dlopen.c")
|
||||
set_base_compile_options(dlopen)
|
||||
target_include_directories(dlopen
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/include
|
||||
@@ -82,6 +84,7 @@ foreach(exe IN LISTS executables_libs executables_mbedcrypto)
|
||||
endif()
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>
|
||||
${extra_sources})
|
||||
set_base_compile_options(${exe})
|
||||
target_include_directories(${exe}
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
target_include_directories(${exe}
|
||||
|
||||
@@ -11,6 +11,7 @@ add_dependencies(${programs_target} ${executables})
|
||||
|
||||
foreach(exe IN LISTS executables)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
@@ -14,6 +14,7 @@ add_dependencies(${programs_target} ${executables})
|
||||
|
||||
foreach(exe IN LISTS executables)
|
||||
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
||||
set_base_compile_options(${exe})
|
||||
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user