cmake/Find: add iphlpapi for c-ares, omit syslibs if dep not found

- add `iphlpapi` library for c-ares.
  Ref: 082d98ba6b

- fix to not add system libs if the dependency was not found.
  librtmp, Rustls, wolfSSL
  Follow-up to 421e592db2 #15832
  Follow-up to 7bab201abe #15193

Closes #16089
This commit is contained in:
Viktor Szakats 2025-01-26 01:17:42 +01:00
parent 7f4f192f04
commit 3e552ef833
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
4 changed files with 36 additions and 30 deletions

View File

@ -90,3 +90,7 @@ else()
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
endif()
if(CARES_FOUND AND WIN32)
list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others
endif()

View File

@ -97,6 +97,6 @@ else()
endif()
endif()
if(WIN32)
if(LIBRTMP_FOUND AND WIN32)
list(APPEND LIBRTMP_LIBRARIES "winmm")
endif()

View File

@ -71,6 +71,7 @@ else()
mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY)
endif()
if(RUSTLS_FOUND)
if(APPLE)
find_library(SECURITY_FRAMEWORK NAMES "Security")
mark_as_advanced(SECURITY_FRAMEWORK)
@ -104,3 +105,4 @@ elseif(NOT WIN32)
endif()
mark_as_advanced(MATH_LIBRARY)
endif()
endif()

View File

@ -90,7 +90,7 @@ else()
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY)
endif()
if(NOT WIN32)
if(WOLFSSL_FOUND AND NOT WIN32)
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow