From: Ricardo Martins Date: Tue, 19 Oct 2021 12:56:02 +0000 (+0100) Subject: CMake: restore support for SecureTransport on iOS X-Git-Tag: curl-7_80_0~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45ee97eb187076825f45c92c0b010952ccbb7b82;p=thirdparty%2Fcurl.git CMake: restore support for SecureTransport on iOS Restore support for building curl for iOS with SecureTransport enabled. Closes #7501 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1420a88787..9715b9f984 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") - find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation") - if(NOT COREFOUNDATION_FRAMEWORK) - message(FATAL_ERROR "CoreFoundation framework not found") - endif() +if(CMAKE_USE_SECTRANSP) + set(use_core_foundation ON) - find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration") - if(NOT SYSTEMCONFIGURATION_FRAMEWORK) - message(FATAL_ERROR "SystemConfiguration framework not found") + find_library(SECURITY_FRAMEWORK "Security") + if(NOT SECURITY_FRAMEWORK) + message(FATAL_ERROR "Security 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() - set(SSL_ENABLED ON) - set(USE_SECTRANSP ON) - list(APPEND CURL_LIBS "-framework Security") +if(use_core_foundation) + find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation") + if(NOT COREFOUNDATION_FRAMEWORK) + message(FATAL_ERROR "CoreFoundation framework not found") endif() + + list(APPEND CURL_LIBS "-framework CoreFoundation") endif() if(CMAKE_USE_OPENSSL)