-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update libcurl to version 7.75 and add SSL support #8463
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,23 @@ if(CHECK_FOR_UPDATES) | |
include(ExternalProject) | ||
message(STATUS "Building libcurl enabled") | ||
|
||
set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_OPENSSL=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_TESTING=OFF ) | ||
set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_LIBSSH2=OFF -DBUILD_TESTING=OFF ) | ||
if (WIN32) | ||
set(CURL_FLAGS ${CURL_FLAGS} -DCURL_STATIC_CRT=ON ) | ||
endif() | ||
|
||
|
||
# Add SSL library flag | ||
if (WIN32) | ||
set(CURL_FLAGS ${CURL_FLAGS} -DCMAKE_USE_SCHANNEL=ON ) | ||
else() | ||
set(CURL_FLAGS ${CURL_FLAGS} -DCMAKE_USE_OPENSSL=ON ) | ||
endif() | ||
|
||
ExternalProject_Add( | ||
libcurl | ||
PREFIX libcurl | ||
GIT_REPOSITORY "https://github.com/curl/curl.git" | ||
GIT_TAG "53cdc2c963e33bc0cc1a51ad2df79396202e07f8" # curl-7_70_0 | ||
GIT_TAG "2f33be817cbce6ad7a36f27dd7ada9219f13584c" # curl-7_75_0 | ||
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/libcurl | ||
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | ||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | ||
|
@@ -37,13 +44,17 @@ if(CHECK_FOR_UPDATES) | |
add_definitions(-DCURL_STATICLIB) # Mandatory for building libcurl as static lib | ||
|
||
target_include_directories(curl INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install/include>) | ||
|
||
target_link_libraries(curl INTERFACE debug ${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install/lib/${CURL_DEBUG_TARGET_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
target_link_libraries(curl INTERFACE optimized ${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install/lib/${CURL_RELEASE_TARGET_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
|
||
# libcurl require ws2_32.lib for windows only | ||
# libcurl required libs per OS | ||
# (Linux require that the link dependency will be added after the libcurl link target that use it) | ||
if (WIN32) | ||
target_link_libraries(curl INTERFACE ws2_32.lib) | ||
target_link_libraries(curl INTERFACE ws2_32.lib crypt32.lib) | ||
else() | ||
find_package(OpenSSL REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If that's required then it need to be propagated into the installation guide/scripts as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure we can explain about the online update flag when it's doing nothing for now. |
||
target_link_libraries(curl INTERFACE OpenSSL::SSL OpenSSL::Crypto) | ||
endif() | ||
|
||
target_link_libraries(curl INTERFACE debug ${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install/lib/${CURL_DEBUG_TARGET_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
target_link_libraries(curl INTERFACE optimized ${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install/lib/${CURL_RELEASE_TARGET_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
|
||
endif() #CHECK_FOR_UPDATES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the keyword should be changed to PRIVATE as they are not supposed to be exposed in the DLL interface.
Same for the below entries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was built same as libusb (the keyword is not part of this PR), ifI try to change it to private I get lots of cmake errors like:
CMake Error at CMake/external_libcurl.cmake:43 (add_library):
Cannot find source file:
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
@maloel / @ev-mp , please say how much effort should be made for changing to PRIVATE.
According to CMAKE , INTERFACE is not like PUBLIC.