Further updates to the CMakeLists.txt to fix the build error in MacOS

This commit is contained in:
Meena Renganathan 2022-03-25 16:22:34 -07:00
parent db58a87fcb
commit 05ffa45907

View File

@ -153,6 +153,22 @@ set (SRCS
add_library (_curl ${SRCS})
set(CURL_LIBS "")
if(APPLE)
find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
message(FATAL_ERROR "SystemConfiguration framework not found")
endif()
set(CURL_LIBS ${CURL_LIBS} "-framework SystemConfiguration")
find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation")
if(NOT COREFOUNDATION_FRAMEWORK)
message(FATAL_ERROR "CoreFoundation framework not found")
endif()
set(CURL_LIBS ${CURL_LIBS} "-framework CoreFoundation")
endif()
target_compile_definitions (_curl PRIVATE
HAVE_CONFIG_H
BUILDING_LIBCURL
@ -166,7 +182,8 @@ target_include_directories (_curl SYSTEM PUBLIC
. # curl_config.h
)
target_link_libraries (_curl PRIVATE OpenSSL::SSL)
set(CURL_LIBS ${CURL_LIBS} OpenSSL::SSL)
target_link_libraries (_curl PRIVATE ${CURL_LIBS})
# The library is large - avoid bloat (XXX: is it?)
target_compile_options (_curl PRIVATE -g0)