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

[curl] Fix static build #12800

Merged
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
10 changes: 5 additions & 5 deletions ports/curl/0002_fix_uwp.patch
Original file line number Diff line number Diff line change
@@ -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()

13 changes: 13 additions & 0 deletions ports/curl/0011_fix_static_build.patch
Original file line number Diff line number Diff line change
@@ -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()

2 changes: 1 addition & 1 deletion ports/curl/CONTROL
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions ports/curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down