diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 903921677..072e74aff 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -29,7 +29,6 @@ set(src_crypto ecp_curves.c entropy.c entropy_poll.c - error.c gcm.c havege.c hkdf.c @@ -65,11 +64,27 @@ set(src_crypto sha512.c threading.c timing.c - version.c - version_features.c xtea.c ) +# For files generated by the parent project (Mbed TLS) when building Mbed +# Crypto as a submodule, ensure that the parent project instance is used. +if(USE_CRYPTO_SUBMODULE) +set(src_crypto + ${src_crypto} + ${CMAKE_SOURCE_DIR}/library/version.c + ${CMAKE_SOURCE_DIR}/library/version_features.c + ${CMAKE_SOURCE_DIR}/library/error.c +) +else() +set(src_crypto + ${src_crypto} + version.c + version_features.c + error.c +) +endif() + set(src_x509 certs.c pkcs11.c