summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRicardo Martins <rasmartins@gmail.com>2021-10-19 13:56:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-10-25 11:12:16 +0200
commit45ee97eb187076825f45c92c0b010952ccbb7b82 (patch)
tree2491d87ae8f8c5cafc6d25edc0cfd82419683793 /CMakeLists.txt
parent7c7b32db2bdeff9895cc0bc4eca58287feb47ff4 (diff)
downloadcurl-45ee97eb187076825f45c92c0b010952ccbb7b82.tar.gz
CMake: restore support for SecureTransport on iOS
Restore support for building curl for iOS with SecureTransport enabled. Closes #7501
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt44
1 files changed, 26 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1420a8878..9715b9f98 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)