diff --git a/src/crypto/BUILD.gn b/src/crypto/BUILD.gn index 718091d655f95f..2135257fd23cd8 100644 --- a/src/crypto/BUILD.gn +++ b/src/crypto/BUILD.gn @@ -60,7 +60,11 @@ static_library("crypto") { public_configs = [] if (chip_crypto == "mbedtls") { sources += [ "CHIPCryptoPALmbedTLS.cpp" ] - public_deps += [ "${mbedtls_root}:mbedtls" ] + + # ESP32 has its own mbedTLS + if (target_cpu != "esp32") { + public_deps += [ "${mbedtls_root}:mbedtls" ] + } } else if (chip_crypto == "openssl") { sources += [ "CHIPCryptoPALOpenSSL.cpp" ] public_configs += [ ":openssl_config" ]