mirror of
https://github.com/curl/curl.git
synced 2026-07-24 18:27:20 +03:00
build: link to Apple frameworks required by static wolfSSL
To fix linking a static wolfSSL library for Apple targets.
Also stop linking `m` and `dl` on Apple platforms.
Matching logic in wolfSSL build code:
8bde512676/CMakeLists.txt (L2520-L2544)
Reported-by: Kai Pastor
Reported-by: Tal Regev
Bug: https://github.com/microsoft/vcpkg/pull/46444#pullrequestreview-3026575393
Ref: https://github.com/microsoft/vcpkg/pull/46444/commits/3a845c4b15066e8167bb4708007180fb6bedf40d
Closes #17945
This commit is contained in:
parent
044de8e19b
commit
2c7902ec4a
2 changed files with 28 additions and 6 deletions
|
|
@ -91,10 +91,26 @@ else()
|
|||
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY)
|
||||
endif()
|
||||
|
||||
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
|
||||
if(WOLFSSL_FOUND)
|
||||
if(APPLE)
|
||||
find_library(SECURITY_FRAMEWORK NAMES "Security")
|
||||
mark_as_advanced(SECURITY_FRAMEWORK)
|
||||
if(NOT SECURITY_FRAMEWORK)
|
||||
message(FATAL_ERROR "Security framework not found")
|
||||
endif()
|
||||
list(APPEND WOLFSSL_LIBRARIES "-framework Security")
|
||||
|
||||
find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation")
|
||||
mark_as_advanced(COREFOUNDATION_FRAMEWORK)
|
||||
if(NOT COREFOUNDATION_FRAMEWORK)
|
||||
message(FATAL_ERROR "CoreFoundation framework not found")
|
||||
endif()
|
||||
list(APPEND WOLFSSL_LIBRARIES "-framework CoreFoundation")
|
||||
elseif(NOT WIN32)
|
||||
find_library(MATH_LIBRARY NAMES "m")
|
||||
if(MATH_LIBRARY)
|
||||
list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow
|
||||
endif()
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
endif()
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -76,6 +76,12 @@ if test "x$OPT_WOLFSSL" != xno; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if test "$curl_cv_apple" = 'yes'; then
|
||||
addlib="$addlib -framework Security -framework CoreFoundation"
|
||||
else
|
||||
addlib="$addlib -lm"
|
||||
fi
|
||||
|
||||
if test "x$USE_WOLFSSL" != "xyes"; then
|
||||
|
||||
LDFLAGS="$LDFLAGS $addld"
|
||||
|
|
@ -127,7 +133,7 @@ if test "x$OPT_WOLFSSL" != xno; then
|
|||
dnl wolfssl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
|
||||
CURL_SIZEOF(long long)
|
||||
|
||||
LIBS="$addlib -lm $LIBS"
|
||||
LIBS="$addlib $LIBS"
|
||||
|
||||
dnl is this wolfSSL providing the original QUIC API?
|
||||
AC_CHECK_FUNCS([wolfSSL_set_quic_use_legacy_codepoint], [QUIC_ENABLED=yes])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue