1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-13 21:15:08 -05:00
Commit Graph

90 Commits

Author SHA1 Message Date
Cristian Morales Vega
f21cc62832
cmake: make CURL_ZLIB a tri-state variable
By differentiating between ON and AUTO it can make a missing zlib
library a hard error when CURL_ZLIB=ON is used.

Reviewed-by: Jakub Zakrzewski
Closes #6221
Fixes #6173
2020-11-19 13:38:47 +01:00
Tobias Hieta
fd5f35ef0b
cmake: don't pass -fvisibility=hidden to clang-cl on Windows
When using clang-cl on windows -fvisibility=hidden is not an known
argument. Instead it behaves exactly like MSVC in this case. So let's
make sure we take that path.

In CMake clang-cl sets both CMAKE_C_COMPILER_ID=clang and MSVC get's
defined since clang-cl is basically a MSVC emulator. So guarding like we
do in this patch seems logical.

Reviewed-by: Jakub Zakrzewski
Closes #6194
2020-11-10 23:40:33 +01:00
Daniel Stenberg
ac0a88fd25
copyright: fix year ranges
Follow-up from 4d2f800677
2020-11-05 08:22:10 +01:00
Daniel Stenberg
4d2f800677
curl.se: new home
Closes #6172
2020-11-04 23:59:47 +01:00
Gilles Vollant
e13357b14b
content_encoding: add zstd decoding support
include zstd curl patch for Makefile.m32 from vszakats
and include Add CMake support for zstd from Peter Wu

Helped-by: Viktor Szakats
Helped-by: Peter Wu
Closes #5453
2020-07-12 18:11:37 +02:00
Peter Wu
5bfc874a35
CMake: add HTTP/3 support (ngtcp2+nghttp3, quiche)
Add three new CMake Find modules (using the curl license, but I grant
others the right to apply the CMake BSD license instead).

This CMake config is simpler than the autotools one because it assumes
ngtcp2 and nghttp3 to be used together. Another difference is that this
CMake config checks whether QUIC is actually supported by the TLS
library (patched OpenSSL or boringssl) since this can be a common
configuration mistake that could result in build errors later.

Unlike autotools, CMake does not warn you that the features are
experimental. The user is supposed to already know that and read the
documentation. It requires a very special build environment anyway.

Tested with ngtcp2+OpenSSL+nghttp3 and quiche+boringssl, both built from
current git master. Use `LD_DEBUG=files src/curl |& grep need` to figure
out which features (libldap-2.4, libssh2) to disable due to conflicts
with boringssl.

Closes #5359
2020-05-10 23:36:41 +02:00
Brad King
89f1e639f6
cmake: Avoid MSVC C4273 warnings in send/recv checks
We use `check_c_source_compiles` to check possible send/recv signatures
by reproducing the forward declarations from system headers.  On Windows
the `winsock2.h` header adds dll linkage settings to its forward
declaration.  If ours does not match the compiler warns:

    warning C4273: 'recv': inconsistent dll linkage

Add `WINSOCK_API_LINKAGE` to our test signatures when it is defined so
that our linkage is consistent with that from `winsock2.h`.

Fixes #4764
Closes #5232
2020-04-14 23:07:18 +02:00
Daniel Stenberg
9a8b3b3e13
copyright: fix out-of-date copyright ranges and missing headers
Reported by the new script 'scripts/copyright.pl'. The script has a
regex whitelist for the files that don't need copyright headers.

Removed three (mostly usesless) README files from docs/

Closes #5141
2020-03-24 15:05:59 +01:00
Daniel Stenberg
37a0541882
cmake: add support for building with wolfSSL
My working build cmdline:

$ cmake -DCMAKE_PREFIX_PATH=$HOME/build-wolfssl -DCMAKE_USE_WOLFSSL=ON .

Assisted-by: Brad King
Closes #5095
2020-03-16 22:56:50 +01:00
Rolf Eike Beer
fc9312f717 CMake: clean up and improve build procedures
- remove check for unsupported old CMake versions

- do not link to c-ares library twice

- modernize custom Find modules

    - FindLibSSH2:
        - pass version to FPHSA to show it in the output
        - use LIBSSH2_VERSION define to extract the version number in
          one shot. This variable exists in the header for 10 years.
        - remove unneeded code

    - FindNGHTTP2.cmake:
        - drop needless FPHSA argument
        - mark found variables as advanced

    - FindNSS.cmake:
        - show version number

    - FindCARES.cmake:
        - drop default paths
        - use FPHSA instead of checking things by hand

- remove needless explict variable dereference

- simplify count_true()

- allow all policies up to version 3.16 to be set to NEW

- do not rerun check for -Wstrict-aliasing=3 every time

In contrast to every other compiler flag this has a = in it, which CMake
can't have in a variable name.

- only read the interesting strings from curlver.h

Reviewed-by: Peter Wu

Closes https://github.com/curl/curl/pull/4975
2020-02-29 23:14:16 -05:00
nicoguillier
8792a59223 cmake: Improve libssh2 check on Windows
- Add "libssh2" name to FindLibSSH2 library search.

On Windows systems, libSSH2 CMake installation may name the library
"LibSSH2".

Prior to this change cmake only checked for name "ssh2". On Linux that
works fine because it will prepend the "lib", but it doesn't do that on
Windows.

Closes https://github.com/curl/curl/pull/4804
2020-01-11 18:53:32 -05:00
Peter Wu
87b9337c8f CMake: add support for building with the NSS vtls backend
Options are cross-checked with configure.ac and acinclude.m4.
Tested on Arch Linux, untested on other platforms like Windows or macOS.

Closes #4663
Reviewed-by: Kamil Dudka
2019-12-04 21:34:02 +00:00
Michael Forney
9b879160df
TLS: add BearSSL vtls implementation
Closes #4597
2019-11-26 08:32:23 +01:00
Vilhelm Prytz
d0319adb0c
copyrights: update all copyright notices to 2019 on files changed this year
Closes #4547
2019-11-02 23:15:56 +01:00
Paul B. Omta
df85b86a92 build: Remove unused HAVE_LIBSSL and HAVE_LIBCRYPTO defines
Closes https://github.com/curl/curl/pull/4460
2019-10-05 19:18:30 -04:00
Rolf Eike Beer
cd68dfe831
CMake: remove needless newlines at end of gss variables 2019-08-31 11:40:10 +02:00
Daniel Gustafsson
abfef94882 CMake: fix typos and spelling 2019-07-09 22:27:59 +02:00
Kyle Edwards
9d1821755e CMake: Convert errant elseif() to else()
CMake interprets an elseif() with no arguments as elseif(FALSE),
resulting in the elseif() block not being executed. That is not what
was intended here. Change the empty elseif() to an else() as it was
intended.

Closes #4101
Reported-by: Artalus <artalus-mail@yandex.ru>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2019-07-09 22:00:47 +02:00
Marcel Raad
e23c52b329
build: fix Codacy warnings
Reduce variable scopes and remove redundant variable stores.

Closes https://github.com/curl/curl/pull/3975
2019-06-05 20:38:06 +02:00
Marcel Raad
5f8b9fe81d
cmake: restore C89 compatibility of CurlTests.c
I broke it in d1b5cf830b and
97de97daef.

Reported-by: Viktor Szakats
Ref: 97de97daef (commitcomment-33499044)
Closes https://github.com/curl/curl/pull/3868
2019-05-12 09:23:34 +02:00
Marcel Raad
97de97daef
CMake: suppress unused variable warnings
I missed these in commit d1b5cf830b.
2019-05-11 14:19:02 +02:00
Marcel Raad
d1b5cf830b
build: fix Codacy/CppCheck warnings
- remove unused variables
- declare conditionally used variables conditionally
- suppress unused variable warnings in the CMake tests
- remove dead variable stores
- consistently use WIN32 macro to detect Windows

Closes https://github.com/curl/curl/pull/3739
2019-04-11 21:08:44 +02:00
Jakub Zakrzewski
be17f298ff cmake: avoid linking executable for some tests with cmake 3.6+
With CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY, the try_compile()
(which is used by check_c_source_compiles()) will build static library
instead of executable. This avoids linking additional libraries in and thus
speeds up those checks a little.

This commit also avoids #3743 (GSSAPI build errors) on itself with cmake
3.6 or above. That issue was fixed separately for all versions.

Ref: #3744
2019-04-10 19:12:28 +02:00
Sergei Nikulov
99c2e7e554 cmake: updated check for HAVE_POLL_FINE to match autotools 2019-01-16 11:39:34 +03:00
Sergei Nikulov
52e27fe9c6 cmake: added checks for HAVE_VARIADIC_MACROS_C99 and HAVE_VARIADIC_MACROS_GCC 2019-01-11 22:48:54 +03:00
Konstantin Kushnir
a39d8f7056 CMake: fix MIT/Heimdal Kerberos detection
- fix syntax error in FindGSS.cmake
- correct krb5 include directory. FindGSS exports
  "GSS_INCLUDE_DIR" variable.

Closes https://github.com/curl/curl/pull/3316
2018-11-29 02:05:21 -05:00
Tuomo Rinne
e97679a360
cmake: uniform ZLIB to use USE_ variable and clean curl-config.cmake.in
Closes #3123
2018-10-29 17:10:31 +01:00
Tuomo Rinne
dd98c1f34b
cmake: add find_dependency call for ZLIB to CMake config file 2018-10-29 17:10:27 +01:00
dmitrykos
667b5721c7 cmake: test and set missed defines during configuration
Added configuration checks for HAVE_BUILTIN_AVAILABLE and HAVE_CLOCK_GETTIME_MONOTONIC.

Closes #3097
2018-10-05 13:10:41 +03:00
Ruslan Baratov
69328490fc CMake: Improve config installation
Use 'GNUInstallDirs' standard module to set destinations of installed
files.

Use uppercase "CURL" names instead of lowercase "curl" to match standard
'FindCURL.cmake' CMake module:
* https://cmake.org/cmake/help/latest/module/FindCURL.html

Meaning:
* Install 'CURLConfig.cmake' instead of 'curl-config.cmake'
* User should call 'find_package(CURL)' instead of 'find_package(curl)'

Use 'configure_package_config_file' function to generate
'CURLConfig.cmake' file. This will make 'curl-config.cmake.in' template
file smaller and handle components better.  E.g.  current configuration
report no error if user specified unknown components (note: new
configuration expects no components, report error if user will try to
specify any).

Closes https://github.com/curl/curl/pull/2849
2018-10-01 16:16:29 -04:00
Viktor Szakats
b801b453af whitespace fixes
- replace tabs with spaces where possible
- remove line ending spaces
- remove double/triple newlines at EOF
- fix a non-UTF-8 character
- cleanup a few indentations/line continuations
  in manual examples

Closes https://github.com/curl/curl/pull/3037
2018-09-23 22:24:02 +00:00
slodki
71b3c675e8
cmake: don't require OpenSSL if USE_OPENSSL=OFF
User must have OpenSSL installed even if not used by libcurl at all
since 7.61.1 release.  Broken at
7867aaa9a0

Reviewed-by: Sergei Nikulov
Closes #3001
2018-09-18 16:34:23 +02:00
John Butterfield
7867aaa9a0
cmake: link curl to the OpenSSL targets instead of lib absolute paths
Reviewed-by: Jakub Zakrzewski
Reviewed-by: Sergei Nikulov
Closes #2753
2018-08-08 09:35:27 +02:00
Ruslan Baratov
d1207c07d0
CMake: Update scripts to use consistent style
Closes #2727
Reviewed-by: Sergei Nikulov
2018-07-17 11:54:07 +02:00
Ruslan Baratov
e0a4bba730
CMake: remove redundant and old end-of-block syntax
Reviewed-by: Jakub Zakrzewski
Closes #2715
2018-07-09 23:32:57 +02:00
Ruslan Baratov
b4db3a8a07
CMake: Remove unused 'output_var' from 'collect_true'
Variable 'output_var' is not used and can be removed.
Function 'collect_true' renamed to 'count_true'.
2018-07-06 09:35:28 +02:00
Ruslan Baratov
fac400da03
CMake: Remove unused functions
Closes #2711
2018-07-06 09:35:21 +02:00
Sergei Nikulov
954284f919 cmake: fixed comments in compile checks code 2018-05-29 09:13:06 +03:00
maxed
7e93637acd Fix the test for fsetxattr and strerror_r tests in CMake to work without compiling 2018-05-28 08:05:16 +03:00
Don
d22e5e02a2
cmake: add support for brotli
Currently CMake cannot detect Brotli support. This adds detection of the
libraries and associated header files. It also adds this to the
generated config.

Closes #2392
2018-03-19 08:28:32 +01:00
Viktor Szakats
7e35eb7729 spelling fixes
Detected using the `codespell` tool.

Also contains one URL protocol upgrade.

Closes https://github.com/curl/curl/pull/2334
2018-02-23 23:29:01 +00:00
Jakub Zakrzewski
1cb4f5d6e8 cmake: Export libcurl and curl targets to use by other cmake projects
The config files define curl and libcurl targets as imported targets
CURL::curl and CURL::libcurl. For backward compatibility with CMake-
provided find-module the CURL_INCLUDE_DIRS and CURL_LIBRARIES are
also set.

Closes #1879
2017-10-28 17:22:47 +02:00
Sergei Nikulov
440dbcb06e cmake: disable tests and man generation if perl/nroff not found
Fixes https://github.com/curl/curl/issues/1500
Reported-by: Jay Satiro

Fixes https://github.com/curl/curl/pull/1662
Assisted-by: Tom Seddon
Assisted-by: dpull@users.noreply.github.com
Assisted-by: elelel@users.noreply.github.com

Closes https://github.com/curl/curl/pull/1924
2017-10-02 01:32:36 -04:00
Daniel Stenberg
ac8af84527
cmake: move cmake_uninstall.cmake to CMake/
Closes #1756
2017-08-10 15:05:49 +02:00
Daniel Stenberg
40ed7685bf cmake: fix send/recv argument scanner for windows
... by simply trying the Windows argument types first.

Fixes #1640
2017-07-05 09:49:30 +02:00
klemens
f7df67cff0 spelling fixes
Closes #1356
2017-03-26 23:56:23 +02:00
Michael Maltese
813263dc3a CMake: Set at most one SSL library
Ref: https://github.com/curl/curl/pull/1228
2017-03-05 14:42:53 +01:00
Michael Maltese
c6a97466b9 CMake: Add mbedTLS support
Ref: https://github.com/curl/curl/pull/1228
2017-03-05 14:42:53 +01:00
Sean Burford
1c877a0712 cmake: Support curl --xattr when built with cmake
- Test for and set HAVE_FSETXATTR when support for extended file
  attributes is present.

Closes https://github.com/curl/curl/pull/1176
2017-02-01 01:11:52 -05:00
Peter Wu
6aa9cfa2b9 cmake: disable poll for macOS
Mirrors the autotools behavior introduced with curl-7_50_3-83-ga34c7ce.

Fixes #1089
2016-11-06 15:16:52 +01:00