]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake/FindMbedTLS: drop lib duplicates early
authorViktor Szakats <commit@vsz.me>
Wed, 6 Nov 2024 11:40:56 +0000 (12:40 +0100)
committerViktor Szakats <commit@vsz.me>
Sat, 14 Dec 2024 22:43:02 +0000 (23:43 +0100)
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

CMake/FindMbedTLS.cmake

index e361c9636a835529179005cb711a59eb6f13e86f..21d47e0bba2a370946c2c76fcf1fadd5a685bee4 100644 (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}\")")