Skip to content

Commit 213c367

Browse files
committed
Use curl + mbedtls directly instead of wrapper library
1 parent e3a37f7 commit 213c367

File tree

1,084 files changed

+512933
-5152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,084 files changed

+512933
-5152
lines changed

CMakeLists.txt

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ option(BUILD_SHARED_LIBS OFF "Build static")
1111

1212
if(MSVC)
1313
add_definitions(/MP)
14-
add_definitions(/Qpar)
1514
endif()
1615

1716
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")
@@ -34,9 +33,35 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
3433
set(wxBUILD_SHARED OFF CACHE INTERNAL "")
3534
add_subdirectory("wxWidgets" EXCLUDE_FROM_ALL)
3635

37-
set(CPR_BUILD_TESTS OFF CACHE INTERNAL "")
38-
set(CPR_GENERATE_COVERAGE OFF CACHE INTERNAL "")
39-
add_subdirectory("cpr" EXCLUDE_FROM_ALL)
36+
# libcurl
37+
if (MSVC)
38+
# use Windows native SSL instead of OpenSSL or MbedTLS
39+
set(CURL_USE_SCHANNEL ON CACHE INTERNAL "")
40+
else()
41+
# for curl SSL
42+
set(ENABLE_TESTING OFF CACHE INTERNAL "")
43+
set(ENABLE_PROGRAMS OFF CACHE INTERNAL "")
44+
set(CURL_USE_MBEDTLS ON CACHE INTERNAL "")
45+
add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
46+
set(MBEDTLS_LIBRARIES "mbedtls")
47+
endif()
48+
set(BUILD_TESTING OFF)
49+
set(USE_OPENSSL OFF)
50+
set(CURL_USE_LIBSSH2 OFF)
51+
set(CURL_DISABLE_FTP ON) # disable unused features & protocols
52+
set(CURL_DISABLE_FILE ON)
53+
set(CURL_DISABLE_TELNET ON)
54+
set(CURL_DISABLE_LDAP ON)
55+
set(CURL_DISABLE_DICT ON)
56+
set(CURL_DISABLE_TFTP ON)
57+
set(CURL_DISABLE_GOPHER ON)
58+
set(CURL_DISABLE_IMAP ON)
59+
set(CURL_DISABLE_SMB ON)
60+
set(CURL_DISABLE_SMTP ON)
61+
set(CURL_DISABLE_RTSP ON)
62+
set(CURL_DISABLE_MQTT ON)
63+
set(CURL_DISABLE_POP3 ON)
64+
add_subdirectory(curl EXCLUDE_FROM_ALL)
4065

4166
add_subdirectory("fmt" EXCLUDE_FROM_ALL)
4267

@@ -45,7 +70,7 @@ target_link_libraries("${PROJECT_NAME}"
4570
wx::base
4671
wx::core
4772
wx::webview
48-
cpr
73+
CURL::libcurl
4974
fmt
5075
)
5176
target_include_directories(${PROJECT_NAME} PUBLIC "fmt/include")

cpr/.clang-format

Lines changed: 0 additions & 59 deletions
This file was deleted.

cpr/.clang-tidy

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)