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
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}\")")