mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
278 lines
6.4 KiB
CMake
278 lines
6.4 KiB
CMake
cmake_minimum_required( VERSION 3.16 )
|
|
|
|
macro( add_mbed_project PROJECT_NAME )
|
|
add_module( "lib" ${PROJECT_NAME} "" ${FOLDER_CONTEXT} TRUE TRUE )
|
|
|
|
if( ${PROJECT_NAME} STREQUAL "libmbedcrypto" )
|
|
add_sources( SOURCE_GROUP "Source"
|
|
"aes.c"
|
|
"aesni.c"
|
|
"aesce.c"
|
|
"aria.c"
|
|
"asn1parse.c"
|
|
"asn1write.c"
|
|
"base64.c"
|
|
"bignum.c"
|
|
"bignum_core.c"
|
|
"bignum_mod.c"
|
|
"bignum_mod_raw.c"
|
|
"camellia.c"
|
|
"ccm.c"
|
|
"chacha20.c"
|
|
"chachapoly.c"
|
|
"cipher.c"
|
|
"cipher_wrap.c"
|
|
"constant_time.c"
|
|
"cmac.c"
|
|
"ctr_drbg.c"
|
|
"des.c"
|
|
"dhm.c"
|
|
"ecdh.c"
|
|
"ecdsa.c"
|
|
"ecjpake.c"
|
|
"ecp.c"
|
|
"ecp_curves.c"
|
|
"entropy.c"
|
|
"entropy_poll.c"
|
|
"error.c"
|
|
"gcm.c"
|
|
"hash_info.c"
|
|
"hkdf.c"
|
|
"hmac_drbg.c"
|
|
"lmots.c"
|
|
"lms.c"
|
|
"md.c"
|
|
"md5.c"
|
|
"memory_buffer_alloc.c"
|
|
"nist_kw.c"
|
|
"oid.c"
|
|
"padlock.c"
|
|
"pem.c"
|
|
"pk.c"
|
|
"pk_wrap.c"
|
|
"pkcs12.c"
|
|
"pkcs5.c"
|
|
"pkparse.c"
|
|
"pkwrite.c"
|
|
"platform.c"
|
|
"platform_util.c"
|
|
"poly1305.c"
|
|
"psa_crypto.c"
|
|
"psa_crypto_aead.c"
|
|
"psa_crypto_cipher.c"
|
|
"psa_crypto_client.c"
|
|
"psa_crypto_driver_wrappers.c"
|
|
"psa_crypto_ecp.c"
|
|
"psa_crypto_hash.c"
|
|
"psa_crypto_mac.c"
|
|
"psa_crypto_pake.c"
|
|
"psa_crypto_rsa.c"
|
|
"psa_crypto_se.c"
|
|
"psa_crypto_slot_management.c"
|
|
"psa_crypto_storage.c"
|
|
"psa_its_file.c"
|
|
"psa_util.c"
|
|
"ripemd160.c"
|
|
"rsa.c"
|
|
"rsa_alt_helpers.c"
|
|
"sha1.c"
|
|
"sha256.c"
|
|
"sha512.c"
|
|
"threading.c"
|
|
"timing.c"
|
|
"version.c"
|
|
"version_features.c"
|
|
)
|
|
|
|
add_sources( SOURCE_GROUP "include/MbedTLS"
|
|
"aesce.h"
|
|
"aesni.h"
|
|
"bignum_core.h"
|
|
"bignum_mod.h"
|
|
"bignum_mod_raw.h"
|
|
"bignum_mod_raw_invasive.h"
|
|
"bn_mul.h"
|
|
"check_crypto_config.h"
|
|
"cipher_wrap.h"
|
|
"constant_time_internal.h"
|
|
"constant_time_invasive.h"
|
|
"ecp_internal_alt.h"
|
|
"ecp_invasive.h"
|
|
"entropy_poll.h"
|
|
"hash_info.h"
|
|
"lmots.h"
|
|
"md_wrap.h"
|
|
"padlock.h"
|
|
"pkwrite.h"
|
|
"pk_wrap.h"
|
|
"rsa_alt_helpers.h"
|
|
"include/mbedtls/aes.h"
|
|
"include/mbedtls/aria.h"
|
|
"include/mbedtls/asn1.h"
|
|
"include/mbedtls/asn1write.h"
|
|
"include/mbedtls/base64.h"
|
|
"include/mbedtls/bignum.h"
|
|
"include/mbedtls/build_info.h"
|
|
"include/mbedtls/camellia.h"
|
|
"include/mbedtls/ccm.h"
|
|
"include/mbedtls/chacha20.h"
|
|
"include/mbedtls/chachapoly.h"
|
|
"include/mbedtls/check_config.h"
|
|
"include/mbedtls/cipher.h"
|
|
"include/mbedtls/cmac.h"
|
|
"include/mbedtls/compat-2.x.h"
|
|
"include/mbedtls/config_psa.h"
|
|
"include/mbedtls/constant_time.h"
|
|
"include/mbedtls/ctr_drbg.h"
|
|
"include/mbedtls/debug.h"
|
|
"include/mbedtls/des.h"
|
|
"include/mbedtls/dhm.h"
|
|
"include/mbedtls/ecdh.h"
|
|
"include/mbedtls/ecdsa.h"
|
|
"include/mbedtls/ecjpake.h"
|
|
"include/mbedtls/ecp.h"
|
|
"include/mbedtls/entropy.h"
|
|
"include/mbedtls/error.h"
|
|
"include/mbedtls/gcm.h"
|
|
"include/mbedtls/hkdf.h"
|
|
"include/mbedtls/hmac_drbg.h"
|
|
"include/mbedtls/legacy_or_psa.h"
|
|
"include/mbedtls/lms.h"
|
|
"include/mbedtls/mbedtls_config.h"
|
|
"include/mbedtls/md.h"
|
|
"include/mbedtls/md5.h"
|
|
"include/mbedtls/memory_buffer_alloc.h"
|
|
"include/mbedtls/nist_kw.h"
|
|
"include/mbedtls/oid.h"
|
|
"include/mbedtls/pem.h"
|
|
"include/mbedtls/pk.h"
|
|
"include/mbedtls/pkcs12.h"
|
|
"include/mbedtls/pkcs5.h"
|
|
"include/mbedtls/platform.h"
|
|
"include/mbedtls/platform_time.h"
|
|
"include/mbedtls/platform_util.h"
|
|
"include/mbedtls/poly1305.h"
|
|
"include/mbedtls/private_access.h"
|
|
"include/mbedtls/psa_util.h"
|
|
"include/mbedtls/ripemd160.h"
|
|
"include/mbedtls/rsa.h"
|
|
"include/mbedtls/sha1.h"
|
|
"include/mbedtls/sha256.h"
|
|
"include/mbedtls/sha512.h"
|
|
"include/mbedtls/ssl.h"
|
|
"include/mbedtls/threading.h"
|
|
"include/mbedtls/timing.h"
|
|
"include/mbedtls/version.h"
|
|
)
|
|
|
|
add_sources( SOURCE_GROUP "include/PSA"
|
|
"psa_crypto_aead.h"
|
|
"psa_crypto_cipher.h"
|
|
"psa_crypto_core.h"
|
|
"psa_crypto_driver_wrappers.h"
|
|
"psa_crypto_ecp.h"
|
|
"psa_crypto_hash.h"
|
|
"psa_crypto_invasive.h"
|
|
"psa_crypto_its.h"
|
|
"psa_crypto_mac.h"
|
|
"psa_crypto_pake.h"
|
|
"psa_crypto_random_impl.h"
|
|
"psa_crypto_rsa.h"
|
|
"psa_crypto_se.h"
|
|
"psa_crypto_slot_management.h"
|
|
"psa_crypto_storage.h"
|
|
"include/psa/crypto.h"
|
|
"include/psa/crypto_builtin_composites.h"
|
|
"include/psa/crypto_builtin_primitives.h"
|
|
"include/psa/crypto_compat.h"
|
|
"include/psa/crypto_config.h"
|
|
"include/psa/crypto_driver_common.h"
|
|
"include/psa/crypto_driver_contexts_composites.h"
|
|
"include/psa/crypto_driver_contexts_primitives.h"
|
|
"include/psa/crypto_extra.h"
|
|
"include/psa/crypto_platform.h"
|
|
"include/psa/crypto_se_driver.h"
|
|
"include/psa/crypto_sizes.h"
|
|
"include/psa/crypto_struct.h"
|
|
"include/psa/crypto_types.h"
|
|
"include/psa/crypto_values.h"
|
|
)
|
|
endif()
|
|
|
|
if( ${PROJECT_NAME} STREQUAL "libmbedx509" )
|
|
add_sources( SOURCE_GROUP "Source"
|
|
"pkcs7.c"
|
|
"x509.c"
|
|
"x509_create.c"
|
|
"x509_crl.c"
|
|
"x509_crt.c"
|
|
"x509_csr.c"
|
|
"x509write_crt.c"
|
|
"x509write_csr.c"
|
|
)
|
|
|
|
add_sources( SOURCE_GROUP "Include"
|
|
"include/mbedtls/pkcs7.h"
|
|
"include/mbedtls/x509.h"
|
|
"include/mbedtls/x509_crl.h"
|
|
"include/mbedtls/x509_crt.h"
|
|
"include/mbedtls/x509_csr.h"
|
|
)
|
|
endif()
|
|
|
|
if( ${PROJECT_NAME} STREQUAL "libmbedtls" )
|
|
add_sources( SOURCE_GROUP "Source"
|
|
"debug.c"
|
|
"mps_reader.c"
|
|
"mps_trace.c"
|
|
"net_sockets.c"
|
|
"ssl_cache.c"
|
|
"ssl_ciphersuites.c"
|
|
"ssl_client.c"
|
|
"ssl_cookie.c"
|
|
"ssl_debug_helpers_generated.c"
|
|
"ssl_msg.c"
|
|
"ssl_ticket.c"
|
|
"ssl_tls.c"
|
|
"ssl_tls12_client.c"
|
|
"ssl_tls12_server.c"
|
|
"ssl_tls13_keys.c"
|
|
"ssl_tls13_server.c"
|
|
"ssl_tls13_client.c"
|
|
"ssl_tls13_generic.c"
|
|
)
|
|
|
|
add_sources( SOURCE_GROUP "Include"
|
|
"alignment.h"
|
|
"common.h"
|
|
"mps_common.h"
|
|
"mps_error.h"
|
|
"mps_reader.h"
|
|
"mps_trace.h"
|
|
"ssl_client.h"
|
|
"ssl_debug_helpers.h"
|
|
"ssl_misc.h"
|
|
"ssl_tls13_invasive.h"
|
|
"ssl_tls13_keys.h"
|
|
"include/mbedtls/debug.h"
|
|
"include/mbedtls/net_sockets.h"
|
|
"include/mbedtls/ssl_cache.h"
|
|
"include/mbedtls/ssl_ciphersuites.h"
|
|
"include/mbedtls/ssl_cookie.h"
|
|
"include/mbedtls/ssl_ticket.h"
|
|
)
|
|
endif()
|
|
|
|
end_sources()
|
|
|
|
target_include_directories( ${PROJECT_NAME} PRIVATE
|
|
"${THIRDPARTY_SOURCE_DIR}/mbedtls/include/"
|
|
)
|
|
|
|
thirdparty_suppress_warnings()
|
|
endmacro()
|
|
|
|
add_mbed_project( "libmbedcrypto" )
|
|
add_mbed_project( "libmbedx509" )
|
|
add_mbed_project( "libmbedtls" )
|