From dea76199aad32b41af3e6d33a265d62d187a3da2 Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Thu, 13 Aug 2020 01:23:44 +0800 Subject: [PATCH] [curl] Fix static build (#12800) * [curl] Fix static build * Add static patch --- ports/curl/0002_fix_uwp.patch | 10 +++++----- ports/curl/0011_fix_static_build.patch | 13 +++++++++++++ ports/curl/CONTROL | 2 +- ports/curl/portfile.cmake | 1 + 4 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 ports/curl/0011_fix_static_build.patch diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index ae36158755..16c00db4f7 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -1,15 +1,15 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index 62b7b33..9b0e2e1 100644 +index 62b7b33..8a4bd71 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -107,7 +107,9 @@ endif() +@@ -107,6 +107,10 @@ endif() target_link_libraries(${LIB_NAME} ${CURL_LIBS}) --if(WIN32) +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) -+elseif(WIN32) ++endif() ++ + if(WIN32) add_definitions(-D_USRDLL) endif() - diff --git a/ports/curl/0011_fix_static_build.patch b/ports/curl/0011_fix_static_build.patch new file mode 100644 index 0000000000..a50fa287f5 --- /dev/null +++ b/ports/curl/0011_fix_static_build.patch @@ -0,0 +1,13 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 8a4bd71..1927fb0 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -111,7 +111,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) + endif() + +-if(WIN32) ++if(WIN32 AND BUILD_SHARED_LIBS) + add_definitions(-D_USRDLL) + endif() + diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index ef5881da0c..6f50966de0 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,6 +1,6 @@ Source: curl Version: 7.71.1 -Port-Version: 1 +Port-Version: 2 Build-Depends: zlib Homepage: https://github.com/curl/curl Description: A library for transferring data with URLs diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index db1367370f..0ad9cd7a2d 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( 0007_disable_tool_export_curl_target.patch 0009_fix_openssl_config.patch 0010_fix_othertests_cmake.patch + 0011_fix_static_build.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB)