-
Notifications
You must be signed in to change notification settings - Fork 310
add and link libcurl #1422
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
Draft
Neumann-A
wants to merge
10
commits into
microsoft:main
Choose a base branch
from
Neumann-A:link-libcurl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
add and link libcurl #1422
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
55c5758
add and link libcurl
Neumann-A 3b2a4a5
wrap in a function instead
Neumann-A 35a6864
deactivate picky compiler options
Neumann-A 8b0ee07
add CURL_STATICLIB to tests
Neumann-A eba2702
Fix VCPKG_DEPENDENCY_EXTERNAL_LIBCURL
Neumann-A 5388d51
Try getting cmake configure logs from workflow
Neumann-A 06d3190
Merge branch 'link-libcurl' of https://github.com/Neumann-A/vcpkg-too…
Neumann-A d9dacdb
try disabling werror for libcurl
Neumann-A 247b52d
adjust comment
Neumann-A 3842038
apply format
Neumann-A File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,65 @@ | ||
option(VCPKG_DEPENDENCY_EXTERNAL_LIBCURL "Use an external version of the libcurl library" OFF) | ||
|
||
# This option exists to allow the URI to be replaced with a Microsoft-internal URI in official | ||
# builds which have restricted internet access; see azure-pipelines/signing.yml | ||
# Note that the SHA512 is the same, so vcpkg-tool contributors need not be concerned that we built | ||
# with different content. | ||
if(NOT VCPKG_LIBCURL_URL) | ||
set(VCPKG_LIBCURL_URL "https://github.com/curl/curl/archive/refs/tags/curl-8_8_0.tar.gz") | ||
endif() | ||
|
||
if(POLICY CMP0135) | ||
cmake_policy(SET CMP0135 NEW) | ||
endif() | ||
|
||
include(FetchContent) | ||
FetchContent_Declare( | ||
LibCURL | ||
URL "${VCPKG_LIBCURL_URL}" | ||
URL_HASH "SHA512=e66cbf9bd3ae7b9b031475210b80b883b6a133042fbbc7cf2413f399d1b38aa54ab7322626abd3c6f1af56e0d540221f618aa903bd6b463ac8324f2c4e92dfa8" | ||
) | ||
|
||
if(NOT LibCURL_FIND_REQUIRED) | ||
message(FATAL_ERROR "LibCURL must be REQUIRED") | ||
endif() | ||
|
||
if(VCPKG_DEPENDENCY_EXTERNAL_FMT) | ||
find_package(CURL REQUIRED) | ||
else() | ||
function(get_libcurl) | ||
set(BUILD_SHARED_LIBS OFF) | ||
set(BUILD_STATIC_LIBS ON) | ||
set(BUILD_CURL_EXE OFF) | ||
set(CURL_DISABLE_INSTALL OFF) | ||
#set(CURL_STATIC_CRT ON) | ||
set(ENABLE_UNICODE ON) | ||
set(CURL_ENABLE_EXPORT_TARGET OFF) | ||
set(BUILD_LIBCURL_DOCS OFF) | ||
set(BUILD_MISC_DOCS OFF) | ||
set(ENABLE_CURL_MANUAL OFF) | ||
set(PICKY_COMPILER OFF) | ||
set(CMAKE_DISABLE_FIND_PACKAGE_Perl ON) | ||
set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB ON) | ||
set(CMAKE_DISABLE_FIND_PACKAGE_LibPSL ON) | ||
set(CMAKE_DISABLE_FIND_PACKAGE_LibSSH2 ON) | ||
if(MSVC) # This is in block() so no need to backup the variables | ||
string(APPEND CMAKE_C_FLAGS " /wd6101") | ||
string(APPEND CMAKE_C_FLAGS " /wd6011") | ||
string(APPEND CMAKE_C_FLAGS " /wd6054") | ||
string(APPEND CMAKE_C_FLAGS " /wd6240") | ||
string(APPEND CMAKE_C_FLAGS " /wd6239") | ||
string(APPEND CMAKE_C_FLAGS " /wd6323") | ||
string(APPEND CMAKE_C_FLAGS " /wd6387") | ||
string(APPEND CMAKE_C_FLAGS " /wd28182") | ||
string(APPEND CMAKE_C_FLAGS " /wd28183") | ||
string(APPEND CMAKE_C_FLAGS " /wd28251") | ||
endif() | ||
FetchContent_MakeAvailable(LibCURL) | ||
endfunction() | ||
get_libcurl() | ||
if(NOT TARGET CURL::libcurl) | ||
add_library(CURL::libcurl INTERFACE) | ||
target_link_libraries(CURL::libcurl INTERFACE libcurl_static) | ||
target_compile_options(CURL::libcurl INTERFACE CURL_STATICLIB) | ||
endif() | ||
endif() |
This file contains hidden or 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,11 @@ | ||
|
||
#ifdef _MSC_VER | ||
#pragma warning(push) // Save current warning state | ||
#pragma warning(disable : 6101) // Disable specific warning (e.g., warning 4996) | ||
#endif | ||
|
||
#include <curl/curl.h> | ||
|
||
#ifdef _MSC_VER | ||
#pragma warning(pop) | ||
#endif |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.