Skip to content

Commit 76dcb42

Browse files
committed
Build and packaging fixes for curl 7.74 merge.
1 parent 145f749 commit 76dcb42

File tree

10 files changed

+972
-795
lines changed

10 files changed

+972
-795
lines changed

.gitattributes

+97-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,97 @@
1-
*.dsw -crlf
2-
buildconf eol=lf
3-
configure.ac eol=lf
4-
*.m4 eol=lf
5-
*.in eol=lf
6-
*.am eol=lf
7-
*.sh eol=lf
8-
*.[ch] whitespace=tab-in-indent
1+
* text=auto !eol svneol=native#text/plain
2+
*.gitattributes text svneol=native#text/plain
3+
4+
# Scriptish formats
5+
*.bat text svneol=native#text/plain
6+
*.bsh text svneol=native#text/x-beanshell
7+
*.cgi text svneol=native#text/plain
8+
*.cmd text svneol=native#text/plain
9+
*.js text svneol=native#text/javascript
10+
*.php text svneol=native#text/x-php
11+
*.pl text svneol=native#text/x-perl
12+
*.pm text svneol=native#text/x-perl
13+
*.py text svneol=native#text/x-python
14+
*.sh eol=lf svneol=LF#text/x-sh
15+
configure eol=lf svneol=LF#text/x-sh
16+
17+
# Image formats
18+
*.bmp binary svneol=unset#image/bmp
19+
*.gif binary svneol=unset#image/gif
20+
*.ico binary svneol=unset#image/ico
21+
*.jpeg binary svneol=unset#image/jpeg
22+
*.jpg binary svneol=unset#image/jpeg
23+
*.png binary svneol=unset#image/png
24+
*.tif binary svneol=unset#image/tiff
25+
*.tiff binary svneol=unset#image/tiff
26+
*.svg text svneol=native#image/svg%2Bxml
27+
28+
# Data formats
29+
*.pdf binary svneol=unset#application/pdf
30+
*.avi binary svneol=unset#video/avi
31+
*.doc binary svneol=unset#application/msword
32+
*.dsp text svneol=crlf#text/plain
33+
*.dsw text svneol=crlf#text/plain
34+
*.eps binary svneol=unset#application/postscript
35+
*.json text svneol=native#application/json
36+
*.gz binary svneol=unset#application/gzip
37+
*.mov binary svneol=unset#video/quicktime
38+
*.mp3 binary svneol=unset#audio/mpeg
39+
*.ppt binary svneol=unset#application/vnd.ms-powerpoint
40+
*.ps binary svneol=unset#application/postscript
41+
*.psd binary svneol=unset#application/photoshop
42+
*.rdf binary svneol=unset#text/rdf
43+
*.rss text svneol=unset#text/xml
44+
*.rtf binary svneol=unset#text/rtf
45+
*.sln text svneol=native#text/plain
46+
*.swf binary svneol=unset#application/x-shockwave-flash
47+
*.tgz binary svneol=unset#application/gzip
48+
*.vcproj text svneol=native#text/xml
49+
*.vcxproj text svneol=native#text/xml
50+
*.vsprops text svneol=native#text/xml
51+
*.wav binary svneol=unset#audio/wav
52+
*.xls binary svneol=unset#application/vnd.ms-excel
53+
*.zip binary svneol=unset#application/zip
54+
55+
# Text formats
56+
.htaccess text svneol=native#text/plain
57+
*.bbk text svneol=native#text/xml
58+
*.cmake text svneol=native#text/plain
59+
*.css text svneol=native#text/css
60+
*.dtd text svneol=native#text/xml
61+
*.htm text svneol=native#text/html
62+
*.html text svneol=native#text/html
63+
*.ini text svneol=native#text/plain
64+
*.log text svneol=native#text/plain
65+
*.mak text svneol=native#text/plain
66+
*.qbk text svneol=native#text/plain
67+
*.rst text svneol=native#text/plain
68+
*.sql text svneol=native#text/x-sql
69+
*.txt text svneol=native#text/plain
70+
*.xhtml text svneol=native#text/xhtml%2Bxml
71+
*.xml text svneol=native#text/xml
72+
*.xsd text svneol=native#text/xml
73+
*.xsl text svneol=native#text/xml
74+
*.xslt text svneol=native#text/xml
75+
*.xul text svneol=native#text/xul
76+
*.yml text svneol=native#text/plain
77+
boost-no-inspect text svneol=native#text/plain
78+
CHANGES text svneol=native#text/plain
79+
COPYING text svneol=native#text/plain
80+
INSTALL text svneol=native#text/plain
81+
Jamfile text svneol=native#text/plain
82+
Jamroot text svneol=native#text/plain
83+
Jamfile.v2 text svneol=native#text/plain
84+
Jamrules text svneol=native#text/plain
85+
Makefile* text svneol=native#text/plain
86+
README text svneol=native#text/plain
87+
TODO text svneol=native#text/plain
88+
89+
# Code formats
90+
*.c text svneol=native#text/plain
91+
*.cpp text svneol=native#text/plain
92+
*.h text svneol=native#text/plain
93+
*.hpp text svneol=native#text/plain
94+
*.ipp text svneol=native#text/plain
95+
*.tpp text svneol=native#text/plain
96+
*.jam text svneol=native#text/plain
97+
*.java text svneol=native#text/plain

CMake/Config.cmake.in

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ endif()
77
if(@HAVE_ZLIB@)
88
find_package(ZLIB CONFIG REQUIRED)
99
endif()
10+
if(@HAVE_ZSTD@)
11+
find_package(zstd CONFIG REQUIRED)
12+
endif()
1013
if(@HAVE_LIBSSH2@)
1114
find_package(Libssh2 CONFIG REQUIRED)
1215
endif()

CMake/HunterGate.cmake

+23-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2013-2018, Ruslan Baratov
1+
# Copyright (c) 2013-2019, Ruslan Baratov
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -60,7 +60,7 @@ option(HUNTER_STATUS_PRINT "Print working status" ON)
6060
option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)
6161
option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON)
6262

63-
set(HUNTER_WIKI "https://github.com/ruslo/hunter/wiki")
63+
set(HUNTER_ERROR_PAGE "https://docs.hunter.sh/en/latest/reference/errors")
6464

6565
function(hunter_gate_status_print)
6666
if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG)
@@ -79,9 +79,9 @@ function(hunter_gate_status_debug)
7979
endif()
8080
endfunction()
8181

82-
function(hunter_gate_wiki wiki_page)
83-
message("------------------------------ WIKI -------------------------------")
84-
message(" ${HUNTER_WIKI}/${wiki_page}")
82+
function(hunter_gate_error_page error_page)
83+
message("------------------------------ ERROR ------------------------------")
84+
message(" ${HUNTER_ERROR_PAGE}/${error_page}.html")
8585
message("-------------------------------------------------------------------")
8686
message("")
8787
message(FATAL_ERROR "")
@@ -94,26 +94,25 @@ function(hunter_gate_internal_error)
9494
endforeach()
9595
message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
9696
message("")
97-
hunter_gate_wiki("error.internal")
97+
hunter_gate_error_page("error.internal")
9898
endfunction()
9999

100100
function(hunter_gate_fatal_error)
101-
cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}")
102-
string(COMPARE EQUAL "${hunter_WIKI}" "" have_no_wiki)
103-
if(have_no_wiki)
104-
hunter_gate_internal_error("Expected wiki")
101+
cmake_parse_arguments(hunter "" "ERROR_PAGE" "" "${ARGV}")
102+
if("${hunter_ERROR_PAGE}" STREQUAL "")
103+
hunter_gate_internal_error("Expected ERROR_PAGE")
105104
endif()
106105
message("")
107106
foreach(x ${hunter_UNPARSED_ARGUMENTS})
108107
message("[hunter ** FATAL ERROR **] ${x}")
109108
endforeach()
110109
message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
111110
message("")
112-
hunter_gate_wiki("${hunter_WIKI}")
111+
hunter_gate_error_page("${hunter_ERROR_PAGE}")
113112
endfunction()
114113

115114
function(hunter_gate_user_error)
116-
hunter_gate_fatal_error(${ARGV} WIKI "error.incorrect.input.data")
115+
hunter_gate_fatal_error(${ARGV} ERROR_PAGE "error.incorrect.input.data")
117116
endfunction()
118117

119118
function(hunter_gate_self root version sha1 result)
@@ -195,7 +194,7 @@ function(hunter_gate_detect_root)
195194

196195
hunter_gate_fatal_error(
197196
"Can't detect HUNTER_ROOT"
198-
WIKI "error.detect.hunter.root"
197+
ERROR_PAGE "error.detect.hunter.root"
199198
)
200199
endfunction()
201200

@@ -214,7 +213,7 @@ function(hunter_gate_download dir)
214213
"Settings:"
215214
" HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
216215
" HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
217-
WIKI "error.run.install"
216+
ERROR_PAGE "error.run.install"
218217
)
219218
endif()
220219
string(COMPARE EQUAL "${dir}" "" is_bad)
@@ -323,7 +322,11 @@ function(hunter_gate_download dir)
323322
)
324323

325324
if(NOT download_result EQUAL 0)
326-
hunter_gate_internal_error("Configure project failed")
325+
hunter_gate_internal_error(
326+
"Configure project failed."
327+
"To reproduce the error run: ${CMAKE_COMMAND} -H${dir} -B${build_dir} -G${CMAKE_GENERATOR} ${toolchain_arg} ${make_arg}"
328+
"In directory ${dir}"
329+
)
327330
endif()
328331

329332
hunter_gate_status_print(
@@ -396,7 +399,7 @@ macro(HunterGate)
396399
hunter_gate_fatal_error(
397400
"Please set HunterGate *before* 'project' command. "
398401
"Detected project: ${PROJECT_NAME}"
399-
WIKI "error.huntergate.before.project"
402+
ERROR_PAGE "error.huntergate.before.project"
400403
)
401404
endif()
402405

@@ -466,7 +469,7 @@ macro(HunterGate)
466469
"HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
467470
"Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
468471
"(Use at your own risk!)"
469-
WIKI "error.spaces.in.hunter.root"
472+
ERROR_PAGE "error.spaces.in.hunter.root"
470473
)
471474
endif()
472475
endif()
@@ -514,7 +517,9 @@ macro(HunterGate)
514517
hunter_gate_internal_error("${_sha1_location} not found")
515518
endif()
516519
file(READ "${_sha1_location}" _sha1_value)
517-
string(COMPARE EQUAL "${_sha1_value}" "${HUNTER_GATE_SHA1}" _is_equal)
520+
string(TOLOWER "${_sha1_value}" _sha1_value_lower)
521+
string(TOLOWER "${HUNTER_GATE_SHA1}" _HUNTER_GATE_SHA1_lower)
522+
string(COMPARE EQUAL "${_sha1_value_lower}" "${_HUNTER_GATE_SHA1_lower}" _is_equal)
518523
if(NOT _is_equal)
519524
hunter_gate_internal_error(
520525
"Short SHA1 collision:"

CMakeLists.txt

+47-6
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ include(CheckCCompilerFlag)
4747

4848
include(CMake/HunterGate.cmake)
4949
HunterGate(
50-
URL "https://github.com/ruslo/hunter/archive/v0.22.30.tar.gz"
51-
SHA1 "380a7687ea63898b59a3ee6e3d7c39b1faa1aadc"
50+
URL "https://github.com/cpp-pm/hunter/archive/v0.23.288.tar.gz"
51+
SHA1 "6c9b2bc606d86ae31f96a62fc68f0a593024815b"
5252
)
5353

54-
project( CURL C )
54+
project(CURL C)
5555

5656
file(STRINGS ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS REGEX "#define LIBCURL_VERSION( |_NUM )")
5757
string(REGEX MATCH "#define LIBCURL_VERSION \"[^\"]*"
@@ -357,9 +357,11 @@ option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default})
357357

358358
option(CMAKE_USE_BORINGSSL "Use BoringSSL" OFF)
359359

360-
collect_true(enabled_ssl_options enabled_ssl_options_count
360+
count_true(enabled_ssl_options enabled_ssl_options_count
361361
CMAKE_USE_WINSSL
362362
CMAKE_USE_DARWINSSL
363+
CMAKE_USE_SCHANNEL
364+
CMAKE_USE_SECTRANSP
363365
CMAKE_USE_OPENSSL
364366
CMAKE_USE_MBEDTLS
365367
CMAKE_USE_BEARSSL
@@ -680,14 +682,15 @@ check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
680682

681683
set(HAVE_LIBZ OFF)
682684
set(HAVE_ZLIB_H OFF)
683-
set(HAVE_ZLIB OFF)
685+
set(USE_ZLIB OFF)
686+
option(CURL_ZLIB "Set to ON to enable building curl with zlib support." ON)
684687
if(CURL_ZLIB)
685688
hunter_add_package(ZLIB)
686689
find_package(ZLIB CONFIG REQUIRED)
687690
if(ZLIB_FOUND)
688691
set(HAVE_ZLIB_H ON)
689-
set(HAVE_ZLIB ON)
690692
set(HAVE_LIBZ ON)
693+
set(USE_ZLIB ON)
691694

692695
if(HUNTER_ENABLED)
693696
list(APPEND CURL_LIBS ZLIB::zlib)
@@ -715,6 +718,23 @@ if(CURL_BROTLI)
715718
endif()
716719
endif()
717720

721+
option(CURL_ZSTD "Set to ON to enable building curl with zstd support." OFF)
722+
set(HAVE_ZSTD OFF)
723+
if(CURL_ZSTD)
724+
hunter_add_package(zstd)
725+
find_package(zstd CONFIG REQUIRED)
726+
if(ZLIB_FOUND)
727+
set(HAVE_ZSTD ON)
728+
if(HUNTER_ENABLED)
729+
list(APPEND CURL_LIBS zstd::libzstd_static)
730+
else()
731+
list(APPEND CURL_LIBS ${ZSTD_LIBRARIES})
732+
endif()
733+
include_directories(${ZSTD_INCLUDE_DIRS})
734+
endif()
735+
list(APPEND CMAKE_REQUIRED_INCLUDES ${ZSTD_INCLUDE_DIRS})
736+
endif()
737+
718738
hunter_add_package(intsizeof)
719739
find_package(intsizeof CONFIG REQUIRED)
720740
list(APPEND CURL_LIBS intsizeof::intsizeof)
@@ -1611,6 +1631,27 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/curl"
16111631
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
16121632
FILES_MATCHING PATTERN "*.h")
16131633

1634+
include(CMakePackageConfigHelpers)
1635+
write_basic_package_version_file(
1636+
"${version_config}"
1637+
VERSION ${CURL_VERSION}
1638+
COMPATIBILITY SameMajorVersion
1639+
)
1640+
1641+
# Use:
1642+
# * TARGETS_EXPORT_NAME
1643+
# * PROJECT_NAME
1644+
configure_package_config_file(CMake/curl-config.cmake.in
1645+
"${project_config}"
1646+
INSTALL_DESTINATION ${CURL_INSTALL_CMAKE_DIR}
1647+
)
1648+
1649+
install(
1650+
EXPORT "${TARGETS_EXPORT_NAME}"
1651+
NAMESPACE "${PROJECT_NAME}::"
1652+
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
1653+
)
1654+
16141655
install(
16151656
FILES ${version_config} ${project_config}
16161657
DESTINATION ${CURL_INSTALL_CMAKE_DIR}

lib/CMakeLists.txt

+12-10
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ add_library(
9191
${HHEADERS} ${CSOURCES}
9292
)
9393

94+
add_library(
95+
${PROJECT_NAME}::${LIB_NAME}
96+
ALIAS ${LIB_NAME}
97+
)
98+
9499
if(MSVC AND NOT BUILD_SHARED_LIBS)
95100
set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
96101
endif()
@@ -133,16 +138,13 @@ target_include_directories(${LIB_NAME} INTERFACE
133138
$<BUILD_INTERFACE:${CURL_SOURCE_DIR}/include>)
134139

135140
install(TARGETS ${LIB_NAME}
136-
EXPORT "${targets_export_name}"
137-
ARCHIVE DESTINATION lib
138-
LIBRARY DESTINATION lib
139-
RUNTIME DESTINATION bin
140-
INCLUDES DESTINATION "${include_install_dir}"
141+
EXPORT ${TARGETS_EXPORT_NAME}
142+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
143+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
144+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
141145
)
142146

143-
install(EXPORT "${targets_export_name}"
144-
FILE libcurl-target.cmake
145-
NAMESPACE CURL::
146-
DESTINATION lib/cmake/CURL
147+
export(TARGETS ${LIB_NAME}
148+
APPEND FILE ${PROJECT_BINARY_DIR}/libcurl-target.cmake
149+
NAMESPACE ${PROJECT_NAME}::
147150
)
148-

0 commit comments

Comments
 (0)