[curl] Fix static build (#12800)

* [curl] Fix static build

* Add static patch
This commit is contained in:
NancyLi1013 2020-08-13 01:23:44 +08:00 committed by GitHub
parent d7fc2196c1
commit dea76199aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 6 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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)