The CMake `try_compile` command is especially slow for
the Xcode generator. With this patch applied it first tests
for the currently used (and Open Group specified) send/recv
signature. In case this fails testing falls-back to the
permutations.
speed-up:
```
time cmake .. -GNinja -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DCMAKE_USE_LIBSSH2=OFF
before: 11.64s user 11.09s system 55% cpu 40.754 total
after: 7.84s user 6.57s system 51% cpu 28.074 total
```
```
time cmake .. -GXcode -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DCMAKE_USE_LIBSSH2=OFF
before: 217.07s user 104.15s system 60% cpu 8:51.79 total
after: 108.76s user 51.80s system 58% cpu 4:32.58 total
```
Closes#7158
This was previously defined by the obsolete AC_TYPE_SIGNAL macro,
which was removed in 2682e5f5. The deprecation text says
> Your code may safely assume C89 semantics that RETSIGTYPE is void.
So, remove it and just use void instead.
Closes#6861
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#6221Fixes#6173
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
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
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
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#4764Closes#5232
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
- 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
- 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
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
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>
- 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
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
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
- 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
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
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