-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[curl] Update #18971
Merged
Merged
[curl] Update #18971
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5f53d8d
Modernize portfile
dg0yt 05a3b7b
Don't export implicit link libraries
dg0yt 17c1466
Revise osx framework handling
dg0yt 57030f2
Fix exported per-config location of dependencies
dg0yt c2668f6
Move curl-config to tools, incl. debug variant
dg0yt d64d250
Update to 7.77.0
past-due a8cd2bc
Add WinIDN support and default IDN selection
dg0yt 2abe7ed
Merge branch 'master' of https://github.com/microsoft/vcpkg
dg0yt 89ad5a5
Use pkgconfig for libidn2 configuration
dg0yt b7c71e6
Update to 0.78.0
dg0yt c731965
Remove obsolete nghttp2 staticlib patch
dg0yt a3f10af
Fix libs duplication in pc file
dg0yt 2bae8fa
Resolve transitive deps for pc file/curl-config
dg0yt dd030e3
x-add-version
dg0yt 0192cad
Fix winssl dependencies
dg0yt 95eaf4e
Add winldap feature, not default
dg0yt b4035cc
Update git-tree
dg0yt ae969f2
Merge branch 'master' of https://github.com/microsoft/vcpkg
dg0yt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,14 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index dc7223b..a661cb8 100644 | ||
index 9f6de81..6702845 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -620,9 +620,6 @@ if(NOT CURL_DISABLE_LDAPS) | ||
check_include_file_concat("ldapssl.h" HAVE_LDAPSSL_H) | ||
@@ -632,6 +632,9 @@ endif() | ||
option(USE_LIBIDN2 "Use libidn2 for IDN support" ON) | ||
set(HAVE_LIBIDN2 OFF) | ||
if(USE_LIBIDN2) | ||
+ set(HAVE_LIBIDN2 TRUE) | ||
+ list(APPEND CURL_LIBS ${LIBIDN2_LIBRARIES}) | ||
+elseif(0) | ||
check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2) | ||
endif() | ||
|
||
-# Check for idn | ||
-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) | ||
|
||
@@ -870,6 +867,20 @@ if(CURL_CA_PATH_SET AND NOT USE_OPENSSL AND NOT USE_MBEDTLS) | ||
"Set CURL_CA_PATH=none or enable one of those TLS backends.") | ||
endif() | ||
|
||
+if (CMAKE_USE_IDN2) | ||
+ include(FindPackageHandleStandardArgs) | ||
+ include(SelectLibraryConfigurations) | ||
+ | ||
+ find_path(LIBIDN2_INCLUDE_DIRS idn2.h) | ||
+ find_library(LIBIDN2_LIBRARY_DEBUG NAMES libidn2 idn2 PATHS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib NO_DEFAULT_PATH Release RelWithDebInfo MinSizeRel) | ||
+ find_library(LIBIDN2_LIBRARY_RELEASE NAMES libidn2 idn2 PATHS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib NO_DEFAULT_PATH Debug) | ||
+ select_library_configurations(LIBIDN2) | ||
+ | ||
+ add_definitions(-DHAVE_IDN2_H -DHAVE_LIBIDN2) | ||
+ include_directories(${LIBIDN2_INCLUDE_DIRS}) | ||
+ link_libraries(${LIBIDN2_LIBRARY}) | ||
+endif() | ||
+ | ||
# Check for header files | ||
if(NOT UNIX) | ||
check_include_file_concat("windows.h" HAVE_WINDOWS_H) | ||
@@ -906,7 +917,6 @@ check_include_file_concat("crypto.h" HAVE_CRYPTO_H) | ||
check_include_file_concat("err.h" HAVE_ERR_H) | ||
check_include_file_concat("errno.h" HAVE_ERRNO_H) | ||
check_include_file_concat("fcntl.h" HAVE_FCNTL_H) | ||
-check_include_file_concat("idn2.h" HAVE_IDN2_H) | ||
check_include_file_concat("ifaddrs.h" HAVE_IFADDRS_H) | ||
check_include_file_concat("io.h" HAVE_IO_H) | ||
check_include_file_concat("krb.h" HAVE_KRB_H) | ||
@@ -1362,7 +1372,6 @@ _add_if("libz" HAVE_LIBZ) | ||
_add_if("brotli" HAVE_BROTLI) | ||
_add_if("zstd" HAVE_ZSTD) | ||
_add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX OR USE_THREADS_WIN32) | ||
-_add_if("IDN" HAVE_LIBIDN2) | ||
_add_if("Largefile" (CURL_SIZEOF_CURL_OFF_T GREATER 4) AND | ||
((SIZEOF_OFF_T GREATER 4) OR USE_WIN32_LARGE_FILES)) | ||
# TODO SSP1 (Schannel) check is missing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,59 @@ | ||
diff -urw a/CMakeLists.txt b/CMakeLists.txt | ||
--- a/CMakeLists.txt 2021-05-10 20:46:52.204346972 +0200 | ||
+++ b/CMakeLists.txt 2021-05-11 19:39:00.065235266 +0200 | ||
@@ -1482,6 +1482,12 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 8b2e428..ea430f4 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1462,7 +1462,26 @@ set(includedir "\${prefix}/include") | ||
set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") | ||
set(LIBCURL_LIBS "") | ||
set(libdir "${CMAKE_INSTALL_PREFIX}/lib") | ||
-foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS}) | ||
+function(flatten input output) | ||
+ set(output_libs "${${output}}") | ||
+ set(input_libs "${${input}}") | ||
+ while(input_libs) | ||
+ list(POP_BACK input_libs lib) | ||
+ if(NOT "${lib}" IN_LIST output_libs) | ||
+ if(TARGET "${lib}") | ||
+ get_target_property(link_libs "${lib}" INTERFACE_LINK_LIBRARIES) | ||
+ if(link_libs) | ||
+ flatten(link_libs output_libs) | ||
+ endif() | ||
+ endif() | ||
+ list(PREPEND output_libs "${lib}") | ||
+ endif() | ||
+ endwhile() | ||
+ set("${output}" "${output_libs}" PARENT_SCOPE) | ||
+endfunction() | ||
+set(CURL_LIBS_FLAT "") | ||
+flatten(CURL_LIBS CURL_LIBS_FLAT) | ||
+foreach(_lib ${CURL_LIBS_FLAT}) | ||
if(TARGET "${_lib}") | ||
set(_libname "${_lib}") | ||
get_target_property(_libtype "${_libname}" TYPE) | ||
@@ -1473,12 +1492,26 @@ foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS}) | ||
# this information in the .pc file. | ||
continue() | ||
endif() | ||
+ set(_lib NOTFOUND) | ||
+ if(DEFINED CMAKE_BUILD_TYPE) | ||
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" config) | ||
+ get_target_property(_lib "${_libname}" IMPORTED_LOCATION_${config}) | ||
+ endif() | ||
+ if(NOT _lib) | ||
get_target_property(_lib "${_libname}" LOCATION) | ||
+ endif() | ||
if(NOT _lib) | ||
message(WARNING "Bad lib in library list: ${_libname}") | ||
continue() | ||
endif() | ||
+ elseif(_lib MATCHES "^(.*)/([^/]*)[.]framework$") | ||
endif() | ||
+ if(_lib MATCHES "^(.*)/([^/]*)[.]framework$") | ||
+ if(CMAKE_MATCH_1 IN_LIST CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) | ||
+ set(_lib "-framework ${CMAKE_MATCH_2}") | ||
+ else() | ||
+ set(_lib "-framework ${_lib}") | ||
+ endif() | ||
endif() | ||
+ endif() | ||
if(_lib MATCHES ".*/.*" OR _lib MATCHES "^-") | ||
set(LIBCURL_LIBS "${LIBCURL_LIBS} ${_lib}") | ||
else() | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 6d209be..9f6de81 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -638,7 +638,7 @@ endif() | ||
if(WIN32) | ||
option(USE_WIN32_IDN "Use WinIDN for IDN support" OFF) | ||
if(USE_WIN32_IDN) | ||
- list(APPEND CURL_LIBS "Normaliz") | ||
+ list(APPEND CURL_LIBS "normaliz") | ||
set(WANT_IDN_PROTOTYPES ON) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 09d82f1..f0d99e6 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1507,6 +1507,7 @@ else() | ||
set(ENABLE_SHARED "no") | ||
set(ENABLE_STATIC "yes") | ||
set(LIBCURL_NO_SHARED "${LIBCURL_LIBS}") | ||
+ set(LIBCURL_LIBS "") | ||
endif() | ||
# "a" (Linux) or "lib" (Windows) | ||
string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
diff --git a/curl-config.in b/curl-config.in | ||
index 8b4a29a..e756ae8 100644 | ||
--- a/curl-config.in | ||
+++ b/curl-config.in | ||
@@ -172,7 +172,7 @@ while test $# -gt 0; do | ||
|
||
--static-libs) | ||
if test "X@ENABLE_STATIC@" != "Xno" ; then | ||
- echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ | ||
+ echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_NO_SHARED@ | ||
else | ||
echo "curl was built with static libraries disabled" >&2 | ||
exit 1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is it possible to submit these changes to upsream?
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.
Yes, I am willing to do that. However, this shall not delay the merge of the PR.