cmake: add CURL_CODE_COVERAGE option

To sync up with the `--enable-code-coverage` `./configure` option.

Ref: https://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html
Ref: https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html
Ref: https://clang.llvm.org/docs/SourceBasedCodeCoverage.html

Closes #18468
This commit is contained in:
Viktor Szakats 2025-09-03 14:32:29 +02:00
parent dc3f4fd89b
commit 91720b620e
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
4 changed files with 51 additions and 0 deletions

View file

@ -227,6 +227,7 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
- `BUILD_TESTING`: Build tests. Default: `ON`
- `CURL_CLANG_TIDY`: Run the build through `clang-tidy`. Default: `OFF`
- `CURL_CLANG_TIDYFLAGS`: Custom options to pass to `clang-tidy`. Default: (empty)
- `CURL_CODE_COVERAGE`: Enable code coverage build options. Default: `OFF`
- `CURL_COMPLETION_FISH`: Install fish completions. Default: `OFF`
- `CURL_COMPLETION_FISH_DIR`: Custom fish completion install directory.
- `CURL_COMPLETION_ZSH`: Install zsh completions. Default: `OFF`