-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f342af7
commit 3f30f89
Showing
16 changed files
with
171 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
index 8cea346c3..967312905 100644 | ||
index 6f84919..b838245 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) | ||
@@ -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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
index 1d71e14..62b7b33 100644 | ||
index b838245..3199160 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() | ||
endif() | ||
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 09d82f1..f0d99e6 100644 | ||
index 9919fd3..7e513f6 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1507,6 +1507,7 @@ else() | ||
@@ -1654,6 +1654,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) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
curl is compatible with built-in CMake targets: | ||
|
||
find_package(CURL REQUIRED) | ||
target_link_libraries(main PRIVATE CURL::libcurl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.