]> git.ipfire.org Git - thirdparty/curl.git/commit
cmake: `curl_add_clang_tidy_test_target` tidy-ups
authorViktor Szakats <commit@vsz.me>
Fri, 4 Jul 2025 04:15:54 +0000 (06:15 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 4 Jul 2025 22:40:32 +0000 (00:40 +0200)
commite54c80b397d9396dc4b260935efce7f8d2c47b99
treef6d0cb3e1b24437cbfed2fc329bd58884ecb2978
parent5af2457848357141b3b3c67f7a45a4964ec25233
cmake: `curl_add_clang_tidy_test_target` tidy-ups

- simplify gathering header directories and compiler definitions
  recursively.

- handle the case when the cmake directory object doesn't define header
  directories or compiler definitions.

- honor more corners cases:
  - `INTERFACE_INCLUDE_DIRECTORIES` of the initial target.
  - handle no header directory for initial target.

- de-duplicate header directories and compiler redefinitions to mimic
  CMake.

- drop unnecessary `unset()`s.

Note that the order of header directories remains different compared to
how CMake passes them to the compiler when building tests. The order is
already different in the test target `INCLUDE_DIRECTORIES` property,
preventing to reproduce the exact CMake order. The distinction between
`-I` and `-isystem` is also missing from target properties.

Cherry-picked from #17768

Closes #17814
CMake/Macros.cmake