2021-05-01 19:56:56 +00:00
|
|
|
# CURL
|
|
|
|
|
|
|
|
if(USE_SYSTEM_CURL)
|
2023-07-11 18:40:30 +00:00
|
|
|
message(STATUS "RPCS3: using shared libcurl")
|
2021-05-01 19:56:56 +00:00
|
|
|
find_package(CURL REQUIRED)
|
2023-10-01 20:15:43 +00:00
|
|
|
add_library(3rdparty_libcurl INTERFACE)
|
|
|
|
target_link_libraries(3rdparty_libcurl INTERFACE CURL::libcurl)
|
2021-05-01 19:56:56 +00:00
|
|
|
else()
|
2023-07-11 18:40:30 +00:00
|
|
|
message(STATUS "RPCS3: building libcurl + wolfssl submodules")
|
|
|
|
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")
|
2023-10-05 19:23:18 +00:00
|
|
|
set(BUILD_STATIC_CURL OFF CACHE BOOL "Set to ON to build curl executable with static libcurl.")
|
|
|
|
set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libcurl.")
|
|
|
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Set to ON to build shared libcurl.")
|
2023-07-11 18:40:30 +00:00
|
|
|
# If set to ON then CURL can not find our wolfssl
|
|
|
|
set(CURL_USE_WOLFSSL OFF CACHE BOOL "enable wolfSSL for SSL/TLS")
|
|
|
|
set(CURL_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
|
|
|
set(HTTP_ONLY ON CACHE BOOL "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)")
|
|
|
|
set(USE_LIBIDN2 OFF CACHE BOOL "Use libidn2 for IDN support") # Disabled because MacOS CI doesn't work otherwise
|
2021-05-01 19:56:56 +00:00
|
|
|
set(CURL_CA_PATH "none" CACHE STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
|
2021-09-11 21:55:53 +00:00
|
|
|
if(USE_MSVC_STATIC_CRT)
|
2023-07-11 18:40:30 +00:00
|
|
|
set(CURL_STATIC_CRT ON CACHE BOOL "Use static crt to build curl")
|
2021-09-11 21:55:53 +00:00
|
|
|
endif()
|
2023-07-11 18:40:30 +00:00
|
|
|
if(WIN32)
|
|
|
|
set(ENABLE_UNICODE ON CACHE BOOL "enable Unicode")
|
|
|
|
endif()
|
|
|
|
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")
|
|
|
|
set(CURL_USE_LIBPSL OFF CACHE BOOL "Use libPSL")
|
|
|
|
|
|
|
|
set(SSL_ENABLED ON)
|
|
|
|
set(USE_WOLFSSL ON)
|
2023-10-06 10:02:15 +00:00
|
|
|
set(SHARE_LIB_OBJECT OFF)
|
2023-07-11 18:40:30 +00:00
|
|
|
|
2021-05-02 19:59:32 +00:00
|
|
|
add_subdirectory(curl EXCLUDE_FROM_ALL)
|
2021-09-16 12:59:08 +00:00
|
|
|
|
2023-10-05 19:23:18 +00:00
|
|
|
target_link_libraries(libcurl_static PRIVATE wolfssl)
|
2023-07-11 18:40:30 +00:00
|
|
|
if(MSVC)
|
2023-10-05 19:23:18 +00:00
|
|
|
target_compile_definitions(libcurl_static PRIVATE HAVE_SSIZE_T)
|
2023-07-11 18:40:30 +00:00
|
|
|
endif()
|
2023-10-05 19:23:18 +00:00
|
|
|
|
2023-10-01 20:15:43 +00:00
|
|
|
add_library(3rdparty_libcurl INTERFACE)
|
|
|
|
target_link_libraries(3rdparty_libcurl INTERFACE libcurl_static)
|
2021-09-16 12:59:08 +00:00
|
|
|
|
2021-05-01 19:56:56 +00:00
|
|
|
endif()
|