summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
...
* cmake: do not force Windows target versionsViktor Szakats2022-07-041-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* windows: improve random sourceViktor Szakats2022-07-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* cmake: fix build for mingw cross compileKai Pastor2022-07-031-1/+1
| | | | | | | | | | - 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
* fopen: add Curl_fopen() for better overwriting of filesDaniel Stenberg2022-06-261-0/+1
| | | | | | | Bug: https://curl.se/docs/CVE-2022-32207.html CVE-2022-32207 Reported-by: Harry Sintonen Closes #9050
* rand: stop detecting /dev/urandom in cross-buildsViktor Szakats2022-06-221-2/+4
| | | | | | | | | | | | | | | | | | - 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
* copyright: make repository REUSE compliantmax.mehl2022-06-131-0/+2
| | | | | | | | | | | 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
* cmake: support adding a suffix to the OS valueViktor Szakats2022-05-261-1/+1
| | | | | | | | | | | | | | | | 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
* cmake: fix detecting libidn2Viktor Szakats2022-05-261-2/+3
| | | | | | | | | | | | 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
* cmake: add libpsl supportVincent Torri2022-05-191-0/+25
| | | | | Fixes #8865 Closes #8867
* msh3: add support for QUIC and HTTP/3 using msh3Nick Banks2022-04-101-0/+10
| | | | | | Considered experimental, as the other HTTP/3 backends. Closes #8517
* misc: remove BeOS code and referencesDaniel Stenberg2022-01-171-8/+1
| | | | | | | There has not been a mention of this OS in any commit since December 2004 (58f4af7973e3d2). The OS is also long gone. Closes #8288
* build: enable -Warith-conversionMarcel Raad2022-01-131-1/+1
| | | | | | This makes the behavior consistent between GCC 10 and earlier versions. Closes https://github.com/curl/curl/pull/8271
* build: fix -Wenum-conversion handlingMarcel Raad2022-01-131-1/+1
| | | | | | | Don't enable that warning when warnings are disabled. Also add it to CMake. Closes https://github.com/curl/curl/pull/8271
* cmake: warn on use of the now deprecated symbolsJay Satiro2021-11-251-3/+18
| | | | | | Follow-up to 9108da2c26d Closes #8052
* cmake: private identifiers use CURL_ instead of CMAKE_ prefixDaniel Stenberg2021-11-231-44/+40
| | | | | | | | | Since the 'CMAKE_' prefix is reserved for cmake's own private use. Ref: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html Reported-by: Boris Rasin Fixes #7988 Closes #8044
* cmake: fix error getting LOCATION property on non-imported targetBoris Rasin2021-10-281-6/+4
| | | | Closes #7885
* CMake: restore support for SecureTransport on iOSRicardo Martins2021-10-251-18/+26
| | | | | | Restore support for building curl for iOS with SecureTransport enabled. Closes #7501
* cmake: add CURL_ENABLE_SSL option and make CMAKE_USE_* SSL backend options ↵Ryan Mast2021-10-141-7/+8
| | | | | | depend on it Closes https://github.com/curl/curl/pull/7822
* CMake: remove `HAVE_WINSOCK_H` definitionMarcel Raad2021-09-291-1/+0
| | | | | | It's not used anymore. Closes https://github.com/curl/curl/pull/7795
* Revert "build: remove checks for WinSock 1"Daniel Stenberg2021-09-291-0/+1
| | | | | | | | Due to CI issues This reverts commit c2ea04f92b00b6271627cb218647527b5a50f2fc. Closes #7790
* build: remove checks for WinSock 1Marcel Raad2021-09-281-1/+0
| | | | | | It's not supported anymore. Closes https://github.com/curl/curl/pull/7778
* cmake: with OpenSSL, define OPENSSL_SUPPRESS_DEPRECATEDDaniel Stenberg2021-09-231-0/+2
| | | | | | | | To avoid the "... is deprecated" warnings brought by OpenSSL v3. (We need to address the underlying code at some point of course.) Assisted-by: Jakub Zakrzewski Closes #7767
* cmake: sync CURL_DISABLE optionsDon2021-08-251-40/+61
| | | | | | | | | | | | Adds the full listing of CURL_DISABLE options to the CMake build. Moves all option code, except for CURL_DISABLE_OPENSSL_AUTO_LOA_CONFIG which resides near OpenSSL configuration, to the same block of code. Also sorts the options here and in the cmake config header. Additionally sorted the CURL-DISABLE listing and fixed the CURL_DISABLE_POP3 option. Closes #7624
* curl_setup.h: sync values for HTTP_ONLYDon2021-08-211-0/+1
| | | | | | | | The values for HTTP_ONLY differed between CMakeLists.txt and curl_setup.h. Sync them and sort the values in curl_setup.h to make it easier to spot differences. Closes #7601
* cmake: remove libssh2 feature checksAndrea Pappacoda2021-07-051-9/+0
| | | | | | | libssh2 features are detected based on version since commit 9dbbba997608f7c3c5de1c627c77c8cd2aa85b73 Closes #7343
* cmake: fix support for UnixSockets feature on Win32Li Xinwei2021-06-211-1/+5
| | | | | | | | | | | | | Move the definition of sockaddr_un struct from config-win32.h to curl_setup.h, so that it could be shared by all build systems. Add ADDRESS_FAMILY typedef for old mingw, now old mingw can also use unix sockets. Also fix the build of tests/server/sws.c on Win32 when USE_UNIX_SOCKETS is defined. Closes #7034
* hostip: (macOS) free returned memory of SCDynamicStoreCopyProxiesGregory Muchka2021-06-211-13/+14
| | | | | | | | | | | | | | From Apples documentation on SCDynamicStoreCopyProxies, "Return Value: A dictionary of key-value pairs that represent the current internet proxy settings, or NULL if no proxy settings have been defined or if an error occurred. You must release the returned value." Failure to release the returned value of SCDynamicStoreCopyProxies can result in a memory leak. Source: https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies Closes #7265
* configure/cmake: remove checks for unused gethostbyaddr and gethostbyaddr_rGergely Nagy2021-06-181-14/+0
| | | | Closes #7276
* configure/cmake: remove checks for unused inet_ntoa and inet_ntoa_rGergely Nagy2021-06-181-11/+1
| | | | Closes #7276
* configure/cmake: remove unused define HAVE_PERRORGergely Nagy2021-06-181-1/+0
| | | | Closes #7276
* configure/cmake: remove unused define HAVE_FREEIFADDRSGergely Nagy2021-06-181-1/+0
| | | | Closes #7276
* configure/cmake: remove unused define HAVE_FORKGergely Nagy2021-06-181-1/+0
| | | | Closes #7276
* configure/cmake: remove checks for unused sgtty.hGergely Nagy2021-06-181-1/+0
| | | | Closes #7276
* configure/cmake: remove remaining checks for rsa.hGergely Nagy2021-06-181-1/+0
| | | | Closes #7276
* configure/cmake: remove remaining checks for err.hGergely Nagy2021-06-181-1/+0
| | | | Closes #7276
* configure/cmake: remove remaining checks for crypto.hGergely Nagy2021-06-181-1/+0
| | | | Closes #7276
* cmake: Avoid leaking absolute paths into exported configGregor Jasny2021-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The `find_libarary` command resolves the library or framework into an absolute path. In case of system frameworks which are located within an Xcode-provided SDK this results in the Xcode path and SDK version being part of the library path. Because those library paths end up in the exported CMake config importing curl will fail once the Xcode location or SDK version changes: ```cmake set_target_properties(CURL::libcurl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "lber;ldap;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/SystemConfiguration.framework;OpenSSL::SSL;OpenSSL::Crypto;ZLIB::ZLIB" ) ``` A work-around is to link against system-level frameworks with `-framework XYZ`. In case of `SystemConfiguration` we might be able to omit the lookup-check because we could assume the framework is always present. Closes #7152
* cmake: add CURL_DISABLE_NTLM optiontheawless2021-06-021-4/+6
| | | | Closes #7028
* lib/hostip6.c: make NAT64 address synthesis on macOS workRadek Zajic2021-05-251-0/+8
| | | | Closes #7121
* CMake: add CURL_ENABLE_EXPORT_TARGET optionPaweł Wegner2021-05-251-5/+10
| | | | | | | | | install(EXPORT ...) causes trouble when embedding curl dependencies which don't provide install(EXPORT ...) targets (e.g libressl and nghttp2) with cmake's add_subdirectory. Reviewed-by: Jakub Zakrzewski Closes #7060
* cmake: Use multithreaded compilation on VS 2008+Matias N. Goldberg2021-05-211-0/+5
| | | | | | | Multithreaded compilation has been supported since at least VS 2005 and been robustly stable since at least VS 2008 Closes https://github.com/curl/curl/pull/7109
* cmake: fix two invokes result in different curl_config.hMatias N. Goldberg2021-05-211-2/+4
| | | | | | | | Fixes #7100 Closes #7101 Reviewed-by: Jakub Zakrzewski Signed-off-by: Matias N. Goldberg <dark_sylinc@yahoo.com.ar>
* cmake: detect CURL_SA_FAMILY_TPeng-Yu Chen2021-05-211-0/+10
| | | | | Fixes #7049 Closes #7065
* cmake: check for getppid and utimesDaniel Stenberg2021-05-041-3/+3
| | | | | | | | | | | | | ... as they're checked for in the configure script and are used by source code. Removed checks for perror, setvbuf and strlcat since those defines are not checked for in source code. Bonus: removed HAVE_STRLCPY from a few config-*.h files since that symbol is not used in source code. Closes #6997
* hsts: enable by defaultDaniel Stenberg2021-04-191-0/+3
| | | | | | No longer considered experimental. Closes #6700
* configure: remove use of RETSIGTYPEMichael Forney2021-04-071-7/+0
| | | | | | | | | | | 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
* cmake: support WinIDNLi Xinwei2021-03-291-1/+9
| | | | Closes #6807
* config: fix SSPI enabling NTLM if crypto auth is disabledMarc Hoersken2021-03-291-2/+4
| | | | | | | | | | | Avoid enabling NTLM feature based upon Windows SSPI being enabled in case that crypto auth is disabled. Reported-by: Marcel Raad Follow-up to #6277 Fixes #6803 Closes #6808
* config: fix building SMB with configure using Win32 CryptoMarc Hoersken2021-03-151-22/+29
| | | | | | | | | | | | | | | | | | | Align conditions for NTLM features between CMake and configure builds by differentiating between USE_NTLM and USE_CURL_NTLM_CORE, just like curl_setup.h does internally to detect support of: - USE_NTLM: required for NTLM crypto authentication feature - USE_CURL_NTLM_CORE: required for SMB protocol Implement USE_WIN32_CRYPTO detection by checking for Crypt functions in wincrypt.h which are not available in the Windows App environment. Link advapi32 and crypt32 for Crypto API and Schannel SSL backend. Fix condition of Schannel SSL backend in CMake build accordingly. Reviewed-by: Marcel Raad Closes #6277
* config: remove CURL_SIZEOF_CURL_OFF_T use only SIZEOF_CURL_OFF_TDaniel Stenberg2021-03-111-1/+1
| | | | | | | Make the code consistently use a single name for the size of the "curl_off_t" type. Closes #6702