CMake: support "make programs"

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2024-09-14 12:13:16 +02:00
parent de4d5b7855
commit 5dab92ee4e
12 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,6 @@
set(programs_target "${MBEDTLS_TARGET_PREFIX}programs")
add_custom_target(${programs_target})
add_subdirectory(aes)
add_subdirectory(cipher)
if (NOT WIN32)

View File

@ -1,6 +1,7 @@
set(executables
crypt_and_hash
)
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)

View File

@ -1,6 +1,7 @@
set(executables
cipher_aead_demo
)
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)

View File

@ -15,6 +15,7 @@ set(executables_no_common_c
fuzz_x509csr
fuzz_pkcs7
)
add_dependencies(${programs_target} ${executables_no_common_c})
set(executables_with_common_c
fuzz_privkey
@ -23,6 +24,7 @@ set(executables_with_common_c
fuzz_dtlsserver
fuzz_server
)
add_dependencies(${programs_target} ${executables_with_common_c})
foreach(exe IN LISTS executables_no_common_c executables_with_common_c)

View File

@ -3,6 +3,7 @@ set(executables
hello
md_hmac_demo
)
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)

View File

@ -2,6 +2,7 @@ set(executables_mbedtls
dh_client
dh_server
)
add_dependencies(${programs_target} ${executables_mbedtls})
foreach(exe IN LISTS executables_mbedtls)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
@ -29,6 +30,7 @@ set(executables_mbedcrypto
rsa_verify
rsa_verify_pss
)
add_dependencies(${programs_target} ${executables_mbedcrypto})
foreach(exe IN LISTS executables_mbedcrypto)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)

View File

@ -6,6 +6,7 @@ set(executables
psa_constant_names
psa_hash
)
add_dependencies(${programs_target} ${executables})
if(GEN_FILES)
add_custom_command(

View File

@ -2,6 +2,7 @@ set(executables
gen_entropy
gen_random_ctr_drbg
)
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)

View File

@ -16,6 +16,7 @@ set(executables
ssl_server
ssl_server2
)
add_dependencies(${programs_target} ${executables})
if(GEN_FILES)
# Inform CMake that the following file will be generated as part of the build

View File

@ -8,12 +8,14 @@ set(executables_libs
selftest
udp_proxy
)
add_dependencies(${programs_target} ${executables_libs})
set(executables_mbedcrypto
benchmark
query_compile_time_config
zeroize
)
add_dependencies(${programs_target} ${executables_mbedcrypto})
if(TEST_CPP)
set(cpp_dummy_build_cpp "${CMAKE_CURRENT_BINARY_DIR}/cpp_dummy_build.cpp")

View File

@ -6,6 +6,7 @@ set(executables
pem2der
strerror
)
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)

View File

@ -10,6 +10,7 @@ set(executables
load_roots
req_app
)
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)