Skip to content
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 VCPKG_TAG #4747

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CMake settings
cmake_minimum_required(VERSION 3.19)

set(VCPKG_TAG 2c401863dd54a640aeb26ed736c55489c079323b)
set(VCPKG_TAG f5c5b8ddbb88dec7eed4a5ac54c36d1c64d2d29d)

set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/src/qml/imports CACHE PATH "QML import path for Qt Creator to detect custom modules properly")

Expand Down
24 changes: 24 additions & 0 deletions vcpkg/overlay/curl/0002_fix_uwp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 6f84919..b838245 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -162,6 +162,9 @@ if(BUILD_STATIC_LIBS)
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS "_WINSOCK_DEPRECATED_NO_WARNINGS")
+ endif()
if(CMAKEVERSION AND CMAKESONAME)
set_target_properties(${LIB_STATIC} PROPERTIES
VERSION ${CMAKEVERSION} SOVERSION ${CMAKESONAME})
@@ -197,6 +200,9 @@ if(BUILD_SHARED_LIBS)
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set_property(TARGET ${LIB_SHARED} APPEND PROPERTY COMPILE_DEFINITIONS "_WINSOCK_DEPRECATED_NO_WARNINGS")
+ endif()
if(CMAKEVERSION AND CMAKESONAME)
set_target_properties(${LIB_SHARED} PROPERTIES
VERSION ${CMAKEVERSION} SOVERSION ${CMAKESONAME})
12 changes: 12 additions & 0 deletions vcpkg/overlay/curl/0005_remove_imp_suffix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index b838245..3199160 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -92,7 +92,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
14 changes: 14 additions & 0 deletions vcpkg/overlay/curl/0012-fix-dependency-idn2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b19c68..bb5fba9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -839,7 +839,8 @@ endif()
# Check for idn2
option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
if(USE_LIBIDN2)
- check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2)
+ set(HAVE_LIBIDN2 TRUE)
+ list(INSERT CURL_LIBS 0 ${LIBIDN2_LINK_LIBRARIES})
else()
set(HAVE_LIBIDN2 OFF)
endif()
15 changes: 15 additions & 0 deletions vcpkg/overlay/curl/0020-fix-pc-file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb5fba9..9919fd3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1624,7 +1624,9 @@ 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})
+set(CURL_LIBS_FLAT "")
+vcpkg_curl_flatten(CURL_LIBS CURL_LIBS_FLAT)
+foreach(_lib ${CURL_LIBS_FLAT})
if(TARGET "${_lib}")
set(_libname "${_lib}")
get_target_property(_imported "${_libname}" IMPORTED)
12 changes: 12 additions & 0 deletions vcpkg/overlay/curl/0022-deduplicate-libs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9919fd3..7e513f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1654,6 +1654,7 @@ if(BUILD_SHARED_LIBS)
else()
set(ENABLE_SHARED "no")
set(LIBCURL_NO_SHARED "${LIBCURL_LIBS}")
+ set(LIBCURL_LIBS "")
set(CPPFLAG_CURL_STATICLIB "-DCURL_STATICLIB")
endif()
if(BUILD_STATIC_LIBS)
13 changes: 13 additions & 0 deletions vcpkg/overlay/curl/cmake-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
index c89c686..2f39949 100644
--- a/CMake/curl-config.cmake.in
+++ b/CMake/curl-config.cmake.in
@@ -45,4 +45,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
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()
76 changes: 76 additions & 0 deletions vcpkg/overlay/curl/cmake-project-include.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Process the libs and targets in the variable named by `input`
# into a flat list of libs in the variable named by `output`.
# Simplify -framework elements.
# Use -l where possible.
# Avoid duplicates.
function(vcpkg_curl_flatten input output)
set(output_libs "${${output}}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
string(REGEX REPLACE ";optimized;[^;]*|;debug" "" input_libs "VCPKG;${${input}}")
else()
string(REGEX REPLACE ";debug;[^;]*|;optimized" "" input_libs "VCPKG;${${input}}")
endif()
list(REMOVE_AT input_libs 0)
while(input_libs)
list(POP_BACK input_libs lib)
string(REGEX REPLACE "^.<LINK_ONLY:(.*)>\$" "\\1" lib "${lib}")
if(TARGET "${lib}")
set(import_lib "")
set(import_location "")
get_target_property(type "${lib}" TYPE)
if(NOT type STREQUAL "INTERFACE_LIBRARY")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG)
get_target_property(import_lib "${lib}" IMPORTED_IMPLIB_DEBUG)
get_target_property(import_location "${lib}" IMPORTED_LOCATION_DEBUG)
else()
get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
get_target_property(import_lib "${lib}" IMPORTED_IMPLIB_RELEASE)
get_target_property(import_location "${lib}" IMPORTED_LOCATION_RELEASE)
endif()
if(link_libs)
vcpkg_curl_flatten(link_libs output_libs)
endif()
get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES)
if(link_libs)
vcpkg_curl_flatten(link_libs output_libs)
endif()
if(NOT import_lib)
get_target_property(import_lib "${lib}" IMPORTED_IMPLIB)
endif()
if(NOT import_location)
get_target_property(import_location "${lib}" IMPORTED_LOCATION)
endif()
endif()
get_target_property(link_libs "${lib}" INTERFACE_LINK_LIBRARIES)
if(link_libs)
vcpkg_curl_flatten(link_libs output_libs)
endif()
if(import_lib)
set(lib "${import_lib}")
elseif(import_location)
set(lib "${import_location}")
endif()
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()
elseif(WIN32 AND lib MATCHES ".*/${CMAKE_IMPORT_LIBRARY_PREFIX}([^/]*)${CMAKE_IMPORT_LIBRARY_SUFFIX}")
set(lib -l${CMAKE_MATCH_1})
elseif(lib MATCHES ".*/${CMAKE_STATIC_LIBRARY_PREFIX}([^/]*)${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(lib -l${CMAKE_MATCH_1})
endif()
if(NOT "${lib}" IN_LIST output_libs)
list(PREPEND output_libs "${lib}")
endif()
endwhile()
set("${output}" "${output_libs}" PARENT_SCOPE)
endfunction()

if(USE_LIBIDN2)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBIDN2 REQUIRED libidn2)
endif()
61 changes: 61 additions & 0 deletions vcpkg/overlay/curl/dependencies.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
index 056907c..c89c686 100644
--- a/CMake/curl-config.cmake.in
+++ b/CMake/curl-config.cmake.in
@@ -31,6 +31,16 @@ if(@USE_ZLIB@)
find_dependency(ZLIB @ZLIB_VERSION_MAJOR@)
endif()

+if("@USE_ARES@")
+ find_dependency(c-ares CONFIG)
+endif()
+if("@USE_LIBSSH2@")
+ find_dependency(Libssh2 CONFIG)
+endif()
+if("@HAVE_BROTLI@")
+ find_dependency(unofficial-brotli CONFIG)
+endif()
+
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 049ac34..cc0fe19 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,7 +178,8 @@ set(CURL_LIBS "")

if(ENABLE_ARES)
set(USE_ARES 1)
- find_package(CARES REQUIRED)
+ find_package(CARES NAMES c-ares CONFIG REQUIRED)
+ set(CARES_LIBRARY c-ares::cares)
list(APPEND CURL_LIBS ${CARES_LIBRARY})
endif()

@@ -590,7 +591,9 @@ endif()
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)
set(HAVE_BROTLI OFF)
if(CURL_BROTLI)
- find_package(Brotli REQUIRED)
+ find_package(BROTLI NAMES unofficial-brotli REQUIRED)
+ set(BROTLI_INCLUDE_DIRS "")
+ set(BROTLI_LIBRARIES "unofficial::brotli::brotlidec")
if(BROTLI_FOUND)
set(HAVE_BROTLI ON)
set(CURL_LIBS "${BROTLI_LIBRARIES};${CURL_LIBS}") # For 'ld' linker. Emulate `list(PREPEND ...)` to stay compatible with <v3.15 CMake.
@@ -873,7 +876,13 @@ mark_as_advanced(CURL_USE_LIBSSH2)
set(USE_LIBSSH2 OFF)

if(CURL_USE_LIBSSH2)
- find_package(LibSSH2)
+ find_package(LIBSSH2 NAMES Libssh2 REQUIRED)
+ if(TARGET Libssh2::libssh2_shared)
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_shared)
+ else()
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_static)
+ endif()
+ get_target_property(LIBSSH2_INCLUDE_DIR "${LIBSSH2_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES)
if(LIBSSH2_FOUND)
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
23 changes: 23 additions & 0 deletions vcpkg/overlay/curl/export-components.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e513f6..049ac34 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1727,8 +1727,17 @@ if(CURL_ENABLE_EXPORT_TARGET)
)
endif()

+set(components_file "${CMAKE_CURRENT_BINARY_DIR}/CURLConfigComponents.cmake")
+file(CONFIGURE OUTPUT "${components_file}" CONTENT [[
+foreach(z_vcpkg_curl_component IN ITEMS @SUPPORT_FEATURES@ @SUPPORT_PROTOCOLS@)
+ if(z_vcpkg_curl_component MATCHES "^[-_a-zA-Z0-9]*$")
+ set(CURL_${z_vcpkg_curl_component}_FOUND TRUE)
+ endif()
+endforeach()
+]] @ONLY)
+
install(
- FILES ${version_config} ${project_config}
+ FILES ${version_config} ${project_config} ${components_file}
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)

37 changes: 37 additions & 0 deletions vcpkg/overlay/curl/have_h_errno_assignable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 104767ae480f7adba7ed3f50b7f5bfe29934668d Mon Sep 17 00:00:00 2001
From: Viktor Szakats <[email protected]>
Date: Wed, 11 Oct 2023 16:06:12 +0000
Subject: [PATCH] cmake: fix `HAVE_H_ERRNO_ASSIGNABLE` detection

Fix `HAVE_H_ERRNO_ASSIGNABLE` to not run, only compile its test snippet,
aligning this with autotools. This fixes an error when doing
cross-builds and also actually detects this feature. It affected systems
not allowlisted into this, e.g. SerenityOS.

We used this detection result to enable `HAVE_GETADDRINFO_THREADSAFE`.

Follow-up to 04a3a377d83fd72c4cf7a96c9cb6d44785e33264 #11979
Ref: #12095 (closed in favour of this patch)
Ref: #11964 (effort to sync cmake detections with autotools)

Reported-by: Kartatz on Github
Assisted-by: Kartatz on Github
Fixes #12093
Closes #12094
---
CMake/OtherTests.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMake/OtherTests.cmake b/CMake/OtherTests.cmake
index d67a9059bcdea..f1902d73a31f5 100644
--- a/CMake/OtherTests.cmake
+++ b/CMake/OtherTests.cmake
@@ -172,7 +172,7 @@ if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
}" HAVE_H_ERRNO)

if(NOT HAVE_H_ERRNO)
- check_c_source_runs("${_source_epilogue}
+ check_c_source_compiles("${_source_epilogue}
int main(void)
{
h_errno = 2;
14 changes: 14 additions & 0 deletions vcpkg/overlay/curl/mbedtls-ws2_32.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake
index 814bd97..8b17eac 100644
--- a/CMake/FindMbedTLS.cmake
+++ b/CMake/FindMbedTLS.cmake
@@ -28,6 +28,9 @@ find_library(MBEDX509_LIBRARY mbedx509)
find_library(MBEDCRYPTO_LIBRARY mbedcrypto)

set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")
+if(WIN32)
+ list(APPEND MBEDTLS_LIBRARIES ws2_32)
+endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MbedTLS DEFAULT_MSG
Loading
Loading