Skip to content

Commit

Permalink
Custom cmake and project for rpcs3
Browse files Browse the repository at this point in the history
  • Loading branch information
RipleyTom committed Mar 21, 2020
1 parent 10db3f5 commit aa1a12c
Show file tree
Hide file tree
Showing 4 changed files with 1,292 additions and 6 deletions.
23 changes: 17 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ include_directories(${CURL_SOURCE_DIR}/include)

option(CURL_WERROR "Turn compiler warnings into errors" OFF)
option(PICKY_COMPILER "Enable picky compiler options" ON)
option(BUILD_CURL_EXE "Set to ON to build curl executable." ON)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_CURL_EXE "Set to ON to build curl executable." OFF)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(ENABLE_ARES "Set to ON to enable c-ares support" OFF)
if(WIN32)
option(CURL_STATIC_CRT "Set to ON to build libcurl with static CRT on Windows (/MT)." OFF)
Expand Down Expand Up @@ -140,7 +140,7 @@ endif()

include(CurlSymbolHiding)

option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" ON)
mark_as_advanced(HTTP_ONLY)
option(CURL_DISABLE_FTP "disables FTP" OFF)
mark_as_advanced(CURL_DISABLE_FTP)
Expand Down Expand Up @@ -311,9 +311,10 @@ endif()
option(CMAKE_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF)
option(CMAKE_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF)
option(CMAKE_USE_NSS "Enable NSS for SSL/TLS" OFF)
option(CMAKE_USE_WOLFSSL "Enable WolfSSL for SSL/TLS" ON)

set(openssl_default ON)
if(WIN32 OR CMAKE_USE_SECTRANSP OR CMAKE_USE_WINSSL OR CMAKE_USE_MBEDTLS OR CMAKE_USE_NSS)
if(WIN32 OR CMAKE_USE_SECTRANSP OR CMAKE_USE_WINSSL OR CMAKE_USE_MBEDTLS OR CMAKE_USE_NSS OR CMAKE_USE_WOLFSSL)
set(openssl_default OFF)
endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default})
Expand All @@ -325,6 +326,7 @@ count_true(enabled_ssl_options_count
CMAKE_USE_MBEDTLS
CMAKE_USE_BEARSSL
CMAKE_USE_NSS
CMAKE_USE_WOLFSSL
)
if(enabled_ssl_options_count GREATER "1")
set(CURL_WITH_MULTI_SSL ON)
Expand Down Expand Up @@ -418,6 +420,14 @@ if(CMAKE_USE_NSS)
cmake_pop_check_state()
endif()

if(CMAKE_USE_WOLFSSL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../wolfssl/ ${CMAKE_CURRENT_SOURCE_DIR}/../wolfssl_cmake/)
list(APPEND CURL_LIBS wolfssl-3-static)
set(SSL_ENABLED ON)
set(USE_WOLFSSL ON)
set(HAVE_SNI ON)
endif()

option(USE_NGHTTP2 "Use Nghttp2 library" OFF)
if(USE_NGHTTP2)
find_package(NGHTTP2 REQUIRED)
Expand Down Expand Up @@ -544,7 +554,7 @@ check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2)
# Check for symbol dlopen (same as HAVE_LIBDL)
check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)

option(CURL_ZLIB "Set to ON to enable building curl with zlib support." ON)
option(CURL_ZLIB "Set to ON to enable building curl with zlib support." OFF)
set(HAVE_LIBZ OFF)
set(HAVE_ZLIB_H OFF)
set(USE_ZLIB OFF)
Expand Down Expand Up @@ -689,7 +699,7 @@ set(CURL_CA_BUNDLE "auto" CACHE STRING
"Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
set(CURL_CA_FALLBACK OFF CACHE BOOL
"Set ON to use built-in CA store of TLS backend. Defaults to OFF")
set(CURL_CA_PATH "auto" CACHE STRING
set(CURL_CA_PATH "none" CACHE STRING
"Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")

if("${CURL_CA_BUNDLE}" STREQUAL "")
Expand Down Expand Up @@ -1306,6 +1316,7 @@ _add_if("Secure Transport" SSL_ENABLED AND USE_SECTRANSP)
_add_if("mbedTLS" SSL_ENABLED AND USE_MBEDTLS)
_add_if("BearSSL" SSL_ENABLED AND USE_BEARSSL)
_add_if("NSS" SSL_ENABLED AND USE_NSS)
_add_if("WolfSSL" SSL_ENABLED AND USE_WOLFSSL)
if(_items)
list(SORT _items)
endif()
Expand Down
4 changes: 4 additions & 0 deletions lib/curl_config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,10 @@ ${SIZEOF_TIME_T_CODE}
/* if NSS is enabled */
#cmakedefine USE_NSS 1

/* if WolfSSL is enabled */
#cmakedefine USE_WOLFSSL 1
#cmakedefine HAVE_SNI 1

/* if you have the PK11_CreateManagedGenericObject function */
#cmakedefine HAVE_PK11_CREATEMANAGEDGENERICOBJECT 1

Expand Down
Loading

0 comments on commit aa1a12c

Please sign in to comment.