History log of /curl/CMakeLists.txt (Results 126 – 150 of 405)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 474a947e 11-Oct-2022 Viktor Szakats

cmake: enable more detection on Windows

Enable `HAVE_UNISTD_H`, `HAVE_STRTOK_R` and `HAVE_STRCASECMP` detection
on Windows, instead of having predefined values.

With these featu

cmake: enable more detection on Windows

Enable `HAVE_UNISTD_H`, `HAVE_STRTOK_R` and `HAVE_STRCASECMP` detection
on Windows, instead of having predefined values.

With these features detected correctly, CMake Windows builds get closer
to the autotools and `config-win32.h` ones.

This also fixes detecting `HAVE_FTRUNCATE` correctly, which required
`unistd.h`.

Fixing `ftruncate()` in turn causes a build warning/error with legacy
MinGW/MSYS1 due to an offset type size mismatch. This env misses to
detect `HAVE_FILE_OFFSET_BITS`, which may be a reason. This patch
force-disables `HAVE_FTRUNCATE` for this platform.

Reviewed-by: Daniel Stenberg

Closes #9687

show more ...


# 3b483745 11-Oct-2022 Viktor Szakats

cmake: add missing inet_ntop check

This adds the missing half of the check, next to the other half
already present in `lib/curl_config.h.cmake`.

Force disable `HAVE_INET_NTOP` f

cmake: add missing inet_ntop check

This adds the missing half of the check, next to the other half
already present in `lib/curl_config.h.cmake`.

Force disable `HAVE_INET_NTOP` for old MSVC where it caused compiler
warnings.

Reviewed-by: Daniel Stenberg

Closes #9689

show more ...


# d91c736f 09-Oct-2022 Xiang Xiao

cmake: add the check of HAVE_SOCKETPAIR

which is used by Curl_socketpair

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Closes #9686


# 0c327464 06-Oct-2022 Viktor Szakats

tidy-up: delete parallel/unused feature flags

Detecting headers and lib separately makes sense when headers come in
variations or with extra ones, but this wasn't the case here. These we

tidy-up: delete parallel/unused feature flags

Detecting headers and lib separately makes sense when headers come in
variations or with extra ones, but this wasn't the case here. These were
duplicate/parallel macros that we had to keep in sync with each other
for a working build. This patch leaves a single macro for each of these
dependencies:

- Rely on `HAVE_LIBZ`, delete parallel `HAVE_ZLIB_H`.

Also delete CMake logic making sure these two were in sync, along with
a toggle to turn off that logic, called `CURL_SPECIAL_LIBZ`.

Also delete stray `HAVE_ZLIB` defines.

There is also a `USE_ZLIB` variant in `lib/config-dos.h`. This patch
retains it for compatibility and deprecates it.

- Rely on `USE_LIBSSH2`, delete parallel `HAVE_LIBSSH2_H`.

Also delete `LIBSSH2_WIN32`, `LIBSSH2_LIBRARY` from
`winbuild/MakefileBuild.vc`, these have a role when building libssh2
itself. And `CURL_USE_LIBSSH`, which had no use at all.

Also delete stray `HAVE_LIBSSH2` defines.

- Rely on `USE_LIBSSH`, delete parallel `HAVE_LIBSSH_LIBSSH_H`.

Also delete `LIBSSH_WIN32`, `LIBSSH_LIBRARY` and `HAVE_LIBSSH` from
`winbuild/MakefileBuild.vc`, these were the result of copy-pasting the
libssh2 line, and were not having any use.

- Delete unused `HAVE_LIBPSL_H` and `HAVE_LIBPSL`.

Reviewed-by: Daniel Stenberg

Closes #9652

show more ...


# eb33ccd5 26-Sep-2022 Daniel Stenberg

functypes: provide the recv and send arg and return types

This header is for providing the argument types for recv() and send()
when built to not use a dedicated config-[platfor].h file.

functypes: provide the recv and send arg and return types

This header is for providing the argument types for recv() and send()
when built to not use a dedicated config-[platfor].h file.

Remove the slow brute-force checks from configure and cmake.

This change also removes the use of the types for select, as they were
not used in code.

Closes #9592

show more ...


# 935b1bd4 22-Sep-2022 Daniel Stenberg

mprintf: use snprintf if available

This is the single place in libcurl code where it uses the "native"
s(n)printf() function. Used for writing floats. The use has been
reviewed and v

mprintf: use snprintf if available

This is the single place in libcurl code where it uses the "native"
s(n)printf() function. Used for writing floats. The use has been
reviewed and vetted and uses a HUGE target buffer, but switching to
snprintf() still makes this safer and removes build-time warnings.

Reported-by: Philip Heiduck

Fixes #9569
Closes #9570

show more ...


# 664249d0 09-Sep-2022 Daniel Stenberg

ws: initial websockets support

Closes #8995


# 7b66050e 01-Sep-2022 Marc Hoersken

cmake: skip superfluous hex2dec conversion using math expr

CMake seems to be able to compare two hex values just fine.
Also make sure CURL_TARGET_WINDOWS_VERSION is respected.

A

cmake: skip superfluous hex2dec conversion using math expr

CMake seems to be able to compare two hex values just fine.
Also make sure CURL_TARGET_WINDOWS_VERSION is respected.

Assisted-by: Marcel Raad
Reviewed-by: Viktor Szakats
Reported-by: Keitagit-kun on github

Follow up to #9312
Fixes #9406
Closes #9411

show more ...


# 7cd400a4 31-Aug-2022 Viktor Szakats

cmake: fix original MinGW builds

1. Re-enable `HAVE_GETADDRINFO` detection on Windows

Commit d08ee3c83d6bd416aef62ff844c98e47c4682429 (in 2013) added logic
that automatica

cmake: fix original MinGW builds

1. Re-enable `HAVE_GETADDRINFO` detection on Windows

Commit d08ee3c83d6bd416aef62ff844c98e47c4682429 (in 2013) added logic
that automatically assumed `getaddrinfo()` to be present for builds
with IPv6 enabled. As it turns out, certain toolchains (e.g. original
MinGW) by default target older Windows versions, and thus do not
support `getaddrinfo()` out of the box. The issue was masked for
a while by CMake builds forcing a newer Windows version, but that
logic got deleted in commit 8ba22ffb2030ed91312fc8634e29516cdf0a9761.
Since then, some CI builds started failing due to IPv6 enabled,
`HAVE_GETADDRINFO` set, but `getaddrinfo()` in fact missing.

It also turns out that IPv6 works without `getaddrinfo()` since commit
67a08dca27a6a07b36c7f97252e284ca957ff1a5 (from 2019, via #4662). So,
to resolve all this, we can now revert the initial commit, thus
restoring `getaddrinfo()` detection and support IPv6 regardless of its
outcome.

Reported-by: Daniel Stenberg

2. Omit `bcrypt` with original MinGW

Original (aka legacy/old) MinGW versions do not support `bcrypt`
(introduced with Vista). We already have logic to handle that in
`lib/rand.c` and autotools builds, where we do not call the
unsupported API and do not link `bcrypt`, respectively, when using
original MinGW.

This patch ports that logic to CMake, fixing the link error:
`c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lbcrypt`

Ref: https://ci.appveyor.com/project/curlorg/curl/builds/44624888/job/40vle84cn4vle7s0#L508
Regression since 76172511e7adcf720f4c77bd91f49278300ec97e

Fixes #9214
Fixes #9393
Fixes #9395
Closes #9396

show more ...


# cafb356e 30-Aug-2022 Daniel Stenberg

cmake: set feature PSL if present

... make test 1014 pass when libpsl is used.

Closes #9391


# 109e9730 14-Aug-2022 Marc Hoersken

cmake: add detection of threadsafe feature

Avoids failing test 1014 by replicating configure checks
for HAVE_ATOMIC and _WIN32_WINNT with custom CMake tests.

Reviewed-by: Marcel

cmake: add detection of threadsafe feature

Avoids failing test 1014 by replicating configure checks
for HAVE_ATOMIC and _WIN32_WINNT with custom CMake tests.

Reviewed-by: Marcel Raad

Follow up to #8680
Closes #9312

show more ...


# d48dd157 11-Aug-2022 Daniel Stenberg

config: remove the check for and use of SIZEOF_SHORT

shorts are 2 bytes on all platforms curl runs and have ever run on.

Closes #9291


# 4d738544 19-Jul-2022 Viktor Szakats

tidy-up: delete unused build configuration macros

Most of them feature guards:

- `CURL_INCLUDES_SYS_UIO` [1]
- `HAVE_ALLOCA_H` [2]
- `HAVE_CRYPTO_CLEANUP_ALL_EX_DATA` (unuse

tidy-up: delete unused build configuration macros

Most of them feature guards:

- `CURL_INCLUDES_SYS_UIO` [1]
- `HAVE_ALLOCA_H` [2]
- `HAVE_CRYPTO_CLEANUP_ALL_EX_DATA` (unused since de71e68000c8624ea13f90b136f8734dd0fb1bdc)
- `HAVE_DLFCN_H`
- `HAVE_DLOPEN`
- `HAVE_DOPRNT`
- `HAVE_FCNTL`
- `HAVE_GETHOSTBYNAME` [3]
- `HAVE_GETOPT_H`
- `HAVE_GETPASS`
- `HAVE_GETPROTOBYNAME`
- `HAVE_GETSERVBYNAME`
- `HAVE_IDN_FREE*`
- `HAVE_INET_ADDR`
- `HAVE_IOCTL`
- `HAVE_KRB4`
- `HAVE_KRB_GET_OUR_IP_FOR_REALM`
- `HAVE_KRB_H`
- `HAVE_LDAPSSL_H`
- `HAVE_LDAP_INIT_FD`
- `HAVE_LIBDL`
- `HAVE_LIBNSL`
- `HAVE_LIBRESOLV*`
- `HAVE_LIBUCB`
- `HAVE_LL`
- `HAVE_LOCALTIME_R`
- `HAVE_MALLOC_H`
- `HAVE_MEMCPY`
- `HAVE_MEMORY_H`
- `HAVE_NETINET_IF_ETHER_H`
- `HAVE_NI_WITHSCOPEID`
- `HAVE_OPENSSL_CRYPTO_H`
- `HAVE_OPENSSL_ERR_H`
- `HAVE_OPENSSL_PEM_H`
- `HAVE_OPENSSL_PKCS12_H`
- `HAVE_OPENSSL_RAND_H`
- `HAVE_OPENSSL_RSA_H`
- `HAVE_OPENSSL_SSL_H`
- `HAVE_OPENSSL_X509_H`
- `HAVE_PEM_H`
- `HAVE_POLL`
- `HAVE_RAND_SCREEN`
- `HAVE_RAND_STATUS`
- `HAVE_RECVFROM`
- `HAVE_SETSOCKOPT`
- `HAVE_SETVBUF`
- `HAVE_SIZEOF_LONG_DOUBLE`
- `HAVE_SOCKIO_H`
- `HAVE_SOCK_OPTS`
- `HAVE_STDIO_H`
- `HAVE_STRCASESTR`
- `HAVE_STRFTIME`
- `HAVE_STRLCAT`
- `HAVE_STRNCMPI`
- `HAVE_STRNICMP`
- `HAVE_STRSTR`
- `HAVE_STRUCT_IN6_ADDR`
- `HAVE_TLD_H`
- `HAVE_TLD_STRERROR`
- `HAVE_UNAME`
- `HAVE_USLEEP`
- `HAVE_WINBER_H`
- `HAVE_WRITEV`
- `HAVE_X509_H`
- `LT_OBJDIR`
- `NEED_BASENAME_PROTO`
- `NOT_NEED_LIBNSL`
- `OPENSSL_NO_KRB5`
- `RECVFROM_TYPE*`
- `SIZEOF_LONG_DOUBLE`
- `STRERROR_R_TYPE_ARG3`
- `USE_YASSLEMUL`
- `_USRDLL` (from CMake) [4]

[1] Related parts in `m4/curl-functions.m4` and `configure.ac` might
also be deleted.

[2] Related comment can possibly be deleted in
`packages/vms/generate_config_vms_h_curl.com`.

[3] There are more instances of this in autotools, but I did not dare to
touch those. Looked like it's used to detect socket support.

[4] This is necessary for MFC (Microsoft Foundation Class) DLLs to
force linking MFC components statically to the DLL. `libcurl.dll`
does not use MFC, so we can delete this define.
Ref: https://docs.microsoft.com/cpp/build/regular-dlls-statically-linked-to-mfc

Script that can help finding unused settings like above:
```shell

autoheader configure.ac # generate lib/curl_config.h.in

{
grep -o -E 'set\([A-Z][A-Z0-9_]{3,}' CMake/Platforms/WindowsCache.cmake | sed -E 's|set\(||g'
grep -o -E -h '#define +[A-Z][A-Z0-9_]{3,}' lib/config-*.h | sed -E 's|#define +||g'
grep -o -E '#cmakedefine +[A-Z][A-Z0-9_]{3,}' lib/curl_config.h.cmake | sed -E 's|#cmakedefine +||g'
grep -o -E '#undef +[A-Z][A-Z0-9_]{3,}' lib/curl_config.h.in | sed -E 's|#undef +||g'
} | sort -u | grep -v -F 'HEADER_CURL_' | while read -r def; do
c="$(git grep -w -F "${def}" | grep -v -E -c '(/libcurl\.tmpl|^lib/config-|^lib/curl_config\.h\.cmake|^CMakeLists\.txt|^CMake/Platforms/WindowsCache\.cmake|^packages/vms/config_h\.com|^m4/curl-functions\.m4|^acinclude\.m4|^configure\.ac)')"
if [ "${c}" = '0' ]; then
echo "${def}"
fi
done
```

Reviewed-by: Daniel Stenberg
Closes #9044

show more ...


# ca739917 11-Jul-2022 Viktor Szakats

build: improve OS string in CMake and `config-win32.h`

This patch makes CMake fill the "OS string" with the value of
`CMAKE_C_COMPILER_TARGET`, if passed. This typically contains a tripl

build: improve OS string in CMake and `config-win32.h`

This patch makes CMake fill the "OS string" with the value of
`CMAKE_C_COMPILER_TARGET`, if passed. This typically contains a triplet,
the same we can pass to `./configure` via `--host=`.

For non-CMake, non-autotools, Windows builds, this patch adds the ability
to override the default `OS` value in `lib/config-win32.h`.

With these its possible to get the same OS string across the three build
systems.

This patch supersedes the earlier, partial, CMake-only solution:
435f395f3f8c11eebfcc243ca55ebcc11a19b8b8, thus retiring the
`CURL_OS_SUFFIX` CMake option.

Reviewed-by: Jay Satiro
Closes #9117

show more ...


# 7f8b36b0 28-Jun-2022 Don

cmake: support ngtcp2 boringssl backend

Update the ngtcp2 find module to detect the boringssl backend. Determine
if the underlying OpenSSL implementation is BoringSSL and if so use that

cmake: support ngtcp2 boringssl backend

Update the ngtcp2 find module to detect the boringssl backend. Determine
if the underlying OpenSSL implementation is BoringSSL and if so use that
as the ngtcp2 backend.

Reviewed-by: Jakub Zakrzewski
Closes #9065

show more ...


# 8ba22ffb 04-Jul-2022 Viktor Szakats

cmake: do not force Windows target versions

The goal of this patch is to avoid CMake forcing specific Windows
versions and rely on toolchain defaults or manual selection instead.
Thi

cmake: do not force Windows target versions

The goal of this patch is to avoid CMake forcing specific Windows
versions and rely on toolchain defaults or manual selection instead.
This gives back control to the user. This also brings CMake closer to
how autotools and `Makefile.m32` behaves in this regard.

- CMake had a setting `ENABLE_INET_PTON` defaulting to `ON`, which did
nothing else than fixing the Windows build target to Vista. This also
happened when the toolchain did not have Vista support (e.g. original
MinGW), breaking such builds.

In other environments it did not make a user-facing difference,
because libcurl has its own pton() implementation, so it works well
with or without Vista's inet_pton().

This patch drops this setting. inet_pton() is now used whenever
building for Vista or newer, either when requested manually or by
default with modern toolchains (e.g. mingw-w64). Older envs will fall
back to curl's pton().

Ref: https://github.com/curl/curl/pull/9027#issuecomment-1164157604
Ref: https://github.com/curl/curl/pull/8997#issuecomment-1164344155

- When the user did no select a Windows target version manually, stop
explicitly targeting Windows XP, and instead use the toolchain default.

This may pose an issue with old toolchains defaulting to pre-XP
targets. In such case you must manually target Windows XP via:
`-DCURL_TARGET_WINDOWS_VERSION=0x0501`
or
`-DCMAKE_C_FLAGS=-D_WIN32_WINNT=0x0501`

Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Closes #9046

show more ...


# 76172511 04-Jul-2022 Viktor Szakats

windows: improve random source

- Use the Windows API to seed the fallback random generator.

This ensures to always have a random seed, even when libcurl is built
with a vtls

windows: improve random source

- Use the Windows API to seed the fallback random generator.

This ensures to always have a random seed, even when libcurl is built
with a vtls backend lacking a random generator API, such as rustls
(experimental), GSKit and certain mbedTLS builds, or, when libcurl is
built without a TLS backend. We reuse the Windows-specific random
function from the Schannel backend.

- Implement support for `BCryptGenRandom()` [1] on Windows, as a
replacement for the deprecated `CryptGenRandom()` [2] function.

It is used as the secure random generator for Schannel, and also to
provide entropy for libcurl's fallback random generator. The new
function is supported on Vista and newer via its `bcrypt.dll`. It is
used automatically when building for supported versions. It also works
in UWP apps (the old function did not).

- Clear entropy buffer before calling the Windows random generator.

This avoids using arbitrary application memory as entropy (with
`CryptGenRandom()`) and makes sure to return in a predictable state
when an API call fails.

[1] https://docs.microsoft.com/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom
[2] https://docs.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom

Closes #9027

show more ...


# e584b1c0 02-Jul-2022 Kai Pastor

cmake: fix build for mingw cross compile

- Change normaliz lib name to all lowercase.

This is from a standing patch in vcpkg:
Mingw has libnormaliz.a. For case-sensitive file sy

cmake: fix build for mingw cross compile

- Change normaliz lib name to all lowercase.

This is from a standing patch in vcpkg:
Mingw has libnormaliz.a. For case-sensitive file systems (e.g. cross
builds from Linux), the spelling must match exactly.

Closes https://github.com/curl/curl/pull/9084

show more ...


# 20f9dd6b 25-May-2022 Daniel Stenberg

fopen: add Curl_fopen() for better overwriting of files

Bug: https://curl.se/docs/CVE-2022-32207.html
CVE-2022-32207
Reported-by: Harry Sintonen
Closes #9050


# 70adb81c 22-Jun-2022 Viktor Szakats

rand: stop detecting /dev/urandom in cross-builds

- Prevent CMake to auto-detect /dev/urandom when cross-building.
Before this patch, it would detect it in a cross-build scenario on *n

rand: stop detecting /dev/urandom in cross-builds

- Prevent CMake to auto-detect /dev/urandom when cross-building.
Before this patch, it would detect it in a cross-build scenario on *nix
hosts with this device present. This was a problem for example with
Windows builds, but it could affect any target system with this device
missing. This also syncs detection behaviour with autotools, which also
skips it for cross-builds.
- Also, make sure to never use the file RANDOM_FILE as entropy for libcurl's
fallback random number generator on Windows. Windows does not have the
concept of reading a random stream from a filename, nor any guaranteed
non-world-writable path on disk. With this, a manual misconfiguration or
an overeager auto-detection can no longer result in a user-controllable
seed source.

Reviewed-by: Daniel Stenberg
Closes #9038

show more ...


# ad9bc597 17-May-2022 max.mehl

copyright: make repository REUSE compliant

Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the

copyright: make repository REUSE compliant

Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869

show more ...


# 435f395f 26-May-2022 Viktor Szakats

cmake: support adding a suffix to the OS value

CMake automatically uses the `CMAKE_SYSTEM_NAME` value to fill the OS
string appearing in the --version output after the curl version numbe

cmake: support adding a suffix to the OS value

CMake automatically uses the `CMAKE_SYSTEM_NAME` value to fill the OS
string appearing in the --version output after the curl version number,
for example:

'curl 7.83.1 (Windows)'

This patchs adds the ability to pass a suffix that is appended to this
value. It's useful to add CPU info or other platform details,
for example:

'curl 7.83.1 (Windows-x64)'

Closes #8919

show more ...


# a01e8430 26-May-2022 Viktor Szakats

cmake: fix detecting libidn2

Without this patch, libidn2 detection doesn't even seem to be
attempted. With this patch, cmake can be configured to pick it
up and enable it. Necessary

cmake: fix detecting libidn2

Without this patch, libidn2 detection doesn't even seem to be
attempted. With this patch, cmake can be configured to pick it
up and enable it. Necessary configuration remains manual and
differs from most other dependencies.

If you are aware of a better fix, we're glad hearing about it
in a new Issue.

Closes #8917

show more ...


# ee52bead 19-May-2022 Vincent Torri

cmake: add libpsl support

Fixes #8865
Closes #8867


# 37492ebb 10-Apr-2022 Nick Banks

msh3: add support for QUIC and HTTP/3 using msh3

Considered experimental, as the other HTTP/3 backends.

Closes #8517


12345678910>>...17