From e6c07443d287edc851802da2189cd98ed8eeb9e7 Mon Sep 17 00:00:00 2001 From: abitmore Date: Fri, 28 Oct 2022 20:52:11 +0000 Subject: [PATCH] Support building with curl v7.77 or higher in mac by linking with the Core Foundation framework and the System Configuration framework. --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75028de33c..6df34a6e01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,13 @@ macro(FIND_CURL) find_package(CURL REQUIRED) endif (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB) + if( APPLE AND NOT "${CURL_VERSION_STRING}" VERSION_LESS "7.77.0" ) + list( APPEND CURL_LIBRARIES "-framework CoreFoundation" ) + list( APPEND CURL_LIBRARIES "-framework SystemConfiguration" ) + endif() + + message(STATUS "CURL libraries: ${CURL_LIBRARIES}") + if( WIN32 ) if ( MSVC ) list( APPEND CURL_LIBRARIES Wldap32 ) @@ -261,7 +268,7 @@ else( WIN32 ) # Apple AND Linux if( APPLE ) # Apple Specific Options Here - message( STATUS "Configuring BitShares on OS X" ) + message( STATUS "Configuring BitShares on macOS" ) set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -stdlib=libc++ -Wall -fvisibility-inlines-hidden -fvisibility=hidden" ) else( APPLE ) if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD" )