cmake/FindMbedTLS: drop lib duplicates early

When de-duplicating the list of raw libs, make sure to drop duplicates
from the beginning of the list.

Reported-by: Kai Pastor
Ref: https://github.com/curl/curl/pull/15273#pullrequestreview-2417191841
Closes #15495
This commit is contained in:
Viktor Szakats 2024-11-06 12:40:56 +01:00
parent 9294ca8916
commit f7cd713d38
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -59,7 +59,9 @@ endif()
if(MBEDTLS_FOUND AND MBEDX509_FOUND AND MBEDCRYPTO_FOUND)
list(APPEND MBEDTLS_LIBRARIES ${MBEDX509_LIBRARIES} ${MBEDCRYPTO_LIBRARIES})
list(REVERSE MBEDTLS_LIBRARIES)
list(REMOVE_DUPLICATES MBEDTLS_LIBRARIES)
list(REVERSE MBEDTLS_LIBRARIES)
set(MBEDTLS_PC_REQUIRES "mbedtls")
string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}")
message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")