mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
[curl] Update to 8.3.0 (#33924)
* [curl] Update to 8.3.0 * Add explicit usage * Fix CMake 3.7 compatibility * Update copyright * Update vcpkg-cmake-wrapper
This commit is contained in:
parent
796801acca
commit
08a6cdd73b
@ -1,15 +1,15 @@
|
||||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
||||
index 8cea346c3..967312905 100644
|
||||
--- a/lib/CMakeLists.txt
|
||||
+++ b/lib/CMakeLists.txt
|
||||
@@ -118,6 +118,10 @@ if(CURL_HAS_LTO)
|
||||
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
|
||||
endif()
|
||||
|
||||
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
+ set_property(TARGET ${LIB_NAME} APPEND PROPERTY COMPILE_DEFINITIONS "_WINSOCK_DEPRECATED_NO_WARNINGS")
|
||||
+endif()
|
||||
+
|
||||
if(WIN32)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(MSVC)
|
||||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
||||
index 9bb8f0b..7678f43 100644
|
||||
--- a/lib/CMakeLists.txt
|
||||
+++ b/lib/CMakeLists.txt
|
||||
@@ -216,6 +216,10 @@ if(BUILD_SHARED_LIBS)
|
||||
$<BUILD_INTERFACE:${CURL_SOURCE_DIR}/include>)
|
||||
endif()
|
||||
|
||||
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
+ set_property(TARGET ${LIB_SELECTED} APPEND PROPERTY COMPILE_DEFINITIONS "_WINSOCK_DEPRECATED_NO_WARNINGS")
|
||||
+endif()
|
||||
+
|
||||
add_library(${LIB_NAME} ALIAS ${LIB_SELECTED})
|
||||
add_library(${PROJECT_NAME}::${LIB_NAME} ALIAS ${LIB_SELECTED})
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
||||
index 1d71e14..62b7b33 100644
|
||||
index 7678f43..00f61f8 100644
|
||||
--- a/lib/CMakeLists.txt
|
||||
+++ b/lib/CMakeLists.txt
|
||||
@@ -125,7 +125,6 @@ if(WIN32)
|
||||
if(MSVC)
|
||||
# Add "_imp" as a suffix before the extension to avoid conflicting with
|
||||
# the statically linked "libcurl.lib"
|
||||
- set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
|
||||
endif()
|
||||
endif()
|
||||
elseif(NOT CMAKE_CROSSCOMPILING)
|
||||
@@ -105,7 +105,6 @@ endif()
|
||||
if(WIN32 AND
|
||||
NOT IMPORT_LIB_SUFFIX AND
|
||||
CMAKE_STATIC_LIBRARY_SUFFIX STREQUAL CMAKE_IMPORT_LIBRARY_SUFFIX)
|
||||
- set(IMPORT_LIB_SUFFIX "_imp")
|
||||
endif()
|
||||
|
||||
# Whether to do a single compilation pass for libcurl sources and reuse these
|
||||
|
@ -1,12 +1,12 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 09d82f1..f0d99e6 100644
|
||||
index a35ee52..ee133d5 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1507,6 +1507,7 @@ else()
|
||||
@@ -1611,6 +1611,7 @@ if(BUILD_SHARED_LIBS)
|
||||
else()
|
||||
set(ENABLE_SHARED "no")
|
||||
set(ENABLE_STATIC "yes")
|
||||
set(LIBCURL_NO_SHARED "${LIBCURL_LIBS}")
|
||||
+ set(LIBCURL_LIBS "")
|
||||
set(CPPFLAG_CURL_STATICLIB "-DCURL_STATICLIB")
|
||||
endif()
|
||||
# "a" (Linux) or "lib" (Windows)
|
||||
string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(BUILD_STATIC_LIBS)
|
||||
|
13
ports/curl/cmake-config.patch
Normal file
13
ports/curl/cmake-config.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
|
||||
index 056907c4f..56f7c9dd9 100644
|
||||
--- a/CMake/curl-config.cmake.in
|
||||
+++ b/CMake/curl-config.cmake.in
|
||||
@@ -35,4 +35,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
# Alias for either shared or static library
|
||||
-add_library(@PROJECT_NAME@::libcurl ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
|
||||
+if(NOT TARGET @PROJECT_NAME@::libcurl)
|
||||
+ add_library(@PROJECT_NAME@::libcurl INTERFACE IMPORTED)
|
||||
+ set_target_properties(@PROJECT_NAME@::libcurl PROPERTIES INTERFACE_LINK_LIBRARIES @PROJECT_NAME@::@LIB_SELECTED@)
|
||||
+endif()
|
@ -3,7 +3,7 @@ vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO curl/curl
|
||||
REF "${curl_version}"
|
||||
SHA512 7b0aef4f1cb93d446017a337e752d43254db92e02561875d1eb88eb3020a3efaf5d3f7fdfb1ff12dfd561d526789b284a10bef35af81bd6d9cfb2c3dc325815b
|
||||
SHA512 f4a6a629e42bf635f5fd01e25b6b8c750cd5db20f63d7f2bada4de08851deb4b58135019da8b76028db7f32475d11ae8a53486fb6927a6257a889468da604ce4
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0002_fix_uwp.patch
|
||||
@ -14,6 +14,7 @@ vcpkg_from_github(
|
||||
mbedtls-ws2_32.patch
|
||||
export-components.patch
|
||||
dependencies.patch
|
||||
cmake-config.patch # https://github.com/curl/curl/pull/11913
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
@ -127,4 +128,21 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
endif()
|
||||
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
file(READ "${SOURCE_PATH}/lib/krb5.c" krb5_c)
|
||||
string(REGEX REPLACE "#i.*" "" krb5_c "${krb5_c}")
|
||||
set(krb5_copyright "${CURRENT_BUILDTREES_DIR}/krb5.c Notice")
|
||||
file(WRITE "${krb5_copyright}" "${krb5_c}")
|
||||
|
||||
file(READ "${SOURCE_PATH}/lib/inet_ntop.c" inet_ntop_c)
|
||||
string(REGEX REPLACE "#i.*" "" inet_ntop_c "${inet_ntop_c}")
|
||||
set(inet_ntop_copyright "${CURRENT_BUILDTREES_DIR}/inet_ntop.c and inet_pton.c Notice")
|
||||
file(WRITE "${inet_ntop_copyright}" "${inet_ntop_c}")
|
||||
|
||||
vcpkg_install_copyright(
|
||||
FILE_LIST
|
||||
"${SOURCE_PATH}/COPYING"
|
||||
"${krb5_copyright}"
|
||||
"${inet_ntop_copyright}"
|
||||
)
|
||||
|
4
ports/curl/usage
Normal file
4
ports/curl/usage
Normal file
@ -0,0 +1,4 @@
|
||||
curl is compatible with built-in CMake targets:
|
||||
|
||||
find_package(CURL REQUIRED)
|
||||
target_link_libraries(main PRIVATE CURL::libcurl)
|
@ -13,8 +13,12 @@ _find_package(${ARGS} CONFIG)
|
||||
if(CURL_FOUND)
|
||||
include("${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake")
|
||||
|
||||
get_target_property(_curl_include_dirs CURL::libcurl INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(_curl_link_libraries CURL::libcurl INTERFACE_LINK_LIBRARIES)
|
||||
set(_curl_target CURL::libcurl_shared)
|
||||
if(TARGET CURL::libcurl_static)
|
||||
set(_curl_target CURL::libcurl_static)
|
||||
endif()
|
||||
get_target_property(_curl_include_dirs ${_curl_target} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(_curl_link_libraries ${_curl_target} INTERFACE_LINK_LIBRARIES)
|
||||
if(NOT _curl_link_libraries)
|
||||
set(_curl_link_libraries "")
|
||||
endif()
|
||||
@ -46,13 +50,13 @@ if(CURL_FOUND)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
get_target_property(_curl_location_debug CURL::libcurl IMPORTED_IMPLIB_DEBUG)
|
||||
get_target_property(_curl_location_release CURL::libcurl IMPORTED_IMPLIB_RELEASE)
|
||||
get_target_property(_curl_location_debug ${_curl_target} IMPORTED_IMPLIB_DEBUG)
|
||||
get_target_property(_curl_location_release ${_curl_target} IMPORTED_IMPLIB_RELEASE)
|
||||
endif()
|
||||
|
||||
if(NOT _curl_location_debug AND NOT _curl_location_release)
|
||||
get_target_property(_curl_location_debug CURL::libcurl IMPORTED_LOCATION_DEBUG)
|
||||
get_target_property(_curl_location_release CURL::libcurl IMPORTED_LOCATION_RELEASE)
|
||||
get_target_property(_curl_location_debug ${_curl_target} IMPORTED_LOCATION_DEBUG)
|
||||
get_target_property(_curl_location_release ${_curl_target} IMPORTED_LOCATION_RELEASE)
|
||||
endif()
|
||||
|
||||
set(CURL_INCLUDE_DIRS "${_curl_include_dirs}")
|
||||
@ -66,5 +70,6 @@ if(CURL_FOUND)
|
||||
unset(_curl_link_libraries)
|
||||
unset(_curl_location_debug)
|
||||
unset(_curl_location_release)
|
||||
unset(_curl_target)
|
||||
endif()
|
||||
cmake_policy(POP)
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "curl",
|
||||
"version": "8.2.1",
|
||||
"version": "8.3.0",
|
||||
"description": "A library for transferring data with URLs",
|
||||
"homepage": "https://curl.se/",
|
||||
"license": null,
|
||||
"license": "curl AND ISC AND BSD-3-Clause",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
|
@ -1977,7 +1977,7 @@
|
||||
"port-version": 8
|
||||
},
|
||||
"curl": {
|
||||
"baseline": "8.2.1",
|
||||
"baseline": "8.3.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"curlpp": {
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "11ef099083754220ca800477b81e5ea6e51730ff",
|
||||
"version": "8.3.0",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "1e4df4c9590fb15d2d73014c66dbbc151b624b9b",
|
||||
"version": "8.2.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user