curl/CMake
Viktor Szakats 12a6de2f66
GHA: add iOS jobs with LibreSSL, enable dependencies for Android via vcpkg
iOS:

- add jobs with autotools, CMake, CMake Xcode generator.
  The Xcode generator is >10x slower than Unix Makefiles. Keep it
  because it's the one recommended by CMake and for having its own
  quirks we may want to know about.
- build, cache and use LibreSSL for these jobs.
  With workaround for an iOS build issue fixed in master.
- make Xcode generator work by explicitly disabling code signing.
- make tests and examples build with the Xcode generator by setting
  `-DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl`, to avoid
  "Bundle identifier is missing" errors.
- cmake: disable `CURL_USE_PKGCONFIG` by default for Apple device.
- cmake: add `stdc++` library for BoringSSL and AWS-LC, with
  `OPENSSL_USE_STATIC_LIBS=ON` set.
- cmake: add workaround for Xcode generator issue, where it cannot
  handle two targets depending on one custom command. A better fix may
  be dropping `tool_hugehelp.c` and `tool_ca_embed.c` from curltool
  library. For a future PR.

Android:

- add vcpkg to Android jobs, enable dependencies.
  Assisted-by: Tal Regev via #16045
- make vcpkg work with autotools.
- pass `--with-brotli` to autotools to detect the vcpkg-supplied brotli.
- enable BoringSSL for Android and add a job with it.
- silence 457 CMake configure warnings about the Android NDK CMake
  scripts targeting freshly deprecated CMake versions.

These were much more involved than imagined. Basically nothing works out
of the box, and when combined, everything becomes a unique edge case.
autotools builds were a much easier to make work than CMake ones.

Also:

- GHA/non-native: re-sync names to be shorter and more aligned with
  other workflows.
- GHA: add `persist-credentials: false` where missing.

Unresolved issues:

- `OPENSSL_ROOT_DIR` ignored/mis-used when pointing it to LibreSSL.
  CMake seems to prepend the sysroot to the passed absolute directory.
  Found no workaround.
- CMake when combined with Android, both the Google-recommended method
  and the built-in CMake method fail to provide a way to avoid
  `pkg-config` packages at system directories. Failed to find a knob
  that can remove `/usr/include` from the search path. The workaround is
  to disable zstd. (I enabled it by default in this release, maybe
  premature?: f2adb3b6d7 #15431)
  Disabling `pkg-config` doesn't work because vcpkg dependencies do not
  link without it.
- CMake's Xcode generator is slow because each `try_compile()` feature
  check springs a new CMake + Xcode project taking a long time to run,
  just to compile single-liner C files. A known issue, with no solution.
  `-DCMAKE_MACOSX_BUNDLE=OFF` did not help, limiting build types to
  a single one (e.g. `Debug`) also had no effect.
   make | Xcode | GHA run
  :---- | :---- | :--------------------------------------------------------------------
    16s | 2m57s | https://github.com/curl/curl/actions/runs/12866334102/job/35868712426
    23s | 4m13s | https://github.com/curl/curl/actions/runs/12868128013/job/35874212461
    16s | 3m39s | https://github.com/curl/curl/actions/runs/12859073531/job/35849041880
    14s | 2m23s | https://github.com/curl/curl/actions/runs/12858298423/job/35847201313
    15s | 2m36s | https://github.com/curl/curl/actions/runs/12858058492/job/35846669761
    19s | 3m19s | https://github.com/curl/curl/actions/runs/12868919430/job/35876601168

Closes #16043
2025-01-20 22:32:06 +01:00
..
cmake_uninstall.cmake.in cmake: more small tidy-ups and fixes 2024-08-08 13:48:28 +02:00
CMakeConfigurableFile.in copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
curl-config.cmake.in GHA: add iOS jobs with LibreSSL, enable dependencies for Android via vcpkg 2025-01-20 22:32:06 +01:00
CurlSymbolHiding.cmake Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
CurlTests.c cmake: detect mingw-w64 version, pre-fill HAVE_STRTOK_R 2025-01-17 23:31:57 +01:00
FindBearSSL.cmake cmake: document -D and env build options 2024-10-24 23:06:40 +02:00
FindBrotli.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindCares.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindGSS.cmake cmake: drop redundant opening/closing .* from MATCH expressions 2024-12-20 11:38:59 +01:00
FindLDAP.cmake cmake/FindLDAP: avoid framework locations for libs too (Apple) 2025-01-02 12:55:50 +01:00
FindLibgsasl.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibidn2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibpsl.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibrtmp.cmake cmake: add librtmp Find module 2024-12-27 12:52:23 +01:00
FindLibssh2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibssh.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibuv.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindMbedTLS.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindMSH3.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNettle.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNGHTTP2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNGHTTP3.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNGTCP2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindQuiche.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindRustls.cmake cmake: make system libraries dl, m, pthread customizable 2025-01-02 12:55:50 +01:00
FindWolfSSH.cmake cmake: clear package version after pkg-config detection 2024-10-25 15:04:35 +02:00
FindWolfSSL.cmake cmake: make system libraries dl, m, pthread customizable 2025-01-02 12:55:50 +01:00
FindZstd.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
Macros.cmake cmake: extend zlib's AUTO option to brotli, zstd and enable if found 2024-12-17 04:06:45 +01:00
OtherTests.cmake Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
PickyWarnings.cmake build: fix -Wtrampolines picky warning for gcc 4.x versions 2025-01-10 18:21:10 +01:00
Utilities.cmake cmake: tidy up local variable names 2024-12-28 12:29:59 +01:00
win32-cache.cmake cmake: drop fseeko() pre-fill and check for Windows 2025-01-19 15:03:16 +01:00