CMake: restore support for SecureTransport on iOS

Restore support for building curl for iOS with SecureTransport enabled.

Closes #7501
This commit is contained in:
Ricardo Martins 2021-10-19 13:56:02 +01:00 committed by Daniel Stenberg
parent 7c7b32db2b
commit 45ee97eb18
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -259,6 +259,17 @@ if(ENABLE_IPV6 AND NOT WIN32)
set(ENABLE_IPV6 OFF
CACHE BOOL "Define if you want to enable IPv6 support" FORCE)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT ENABLE_ARES)
set(use_core_foundation ON)
find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
message(FATAL_ERROR "SystemConfiguration framework not found")
endif()
list(APPEND CURL_LIBS "-framework SystemConfiguration")
endif()
endif()
if(USE_MANUAL)
@ -395,29 +406,26 @@ if(CMAKE_USE_DARWINSSL)
message(FATAL_ERROR "The cmake option CMAKE_USE_DARWINSSL was renamed to CMAKE_USE_SECTRANSP.")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(CMAKE_USE_SECTRANSP)
set(use_core_foundation ON)
find_library(SECURITY_FRAMEWORK "Security")
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
set(SSL_ENABLED ON)
set(USE_SECTRANSP ON)
list(APPEND CURL_LIBS "-framework Security")
endif()
if(use_core_foundation)
find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation")
if(NOT COREFOUNDATION_FRAMEWORK)
message(FATAL_ERROR "CoreFoundation framework not found")
endif()
find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
message(FATAL_ERROR "SystemConfiguration framework not found")
endif()
list(APPEND CURL_LIBS "-framework CoreFoundation" "-framework SystemConfiguration")
if(CMAKE_USE_SECTRANSP)
find_library(SECURITY_FRAMEWORK "Security")
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
set(SSL_ENABLED ON)
set(USE_SECTRANSP ON)
list(APPEND CURL_LIBS "-framework Security")
endif()
list(APPEND CURL_LIBS "-framework CoreFoundation")
endif()
if(CMAKE_USE_OPENSSL)