Skip to content

cmake: improve clang-tidy test command-line reproduction#20829

Closed
vszakats wants to merge 3 commits intocurl:masterfrom
vszakats:cm-clang-tidy-t
Closed

cmake: improve clang-tidy test command-line reproduction#20829
vszakats wants to merge 3 commits intocurl:masterfrom
vszakats:cm-clang-tidy-t

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Mar 6, 2026

  • also query INTERFACE_COMPILE_DEFINITIONS and
    INTERFACE_COMPILE_OPTIONS.
    To further sync clang-tidy manual command-lines with the C compiler
    command-lines generated by CMake. In practice this adds -I options
    (via INTERFACE_COMPILE_OPTIONS) to the end of the command-line for
    dependency header directories. It does not change the outcome of
    clang-tidy runs.

  • limit querying COMPILE_DEFINITIONS and COMPILE_OPTIONS to the top
    target, the test itself. To not include options such as
    -DCURL_HIDDEN_SYMBOLS and -fvisibility=hidden (when set) via
    the libcurl shared lib.
    To sync with the actual C compiler command-line.

  • drop redundant unset().

  • rename local function to be more specific.

Follow-up to d9386a2 #20759

vszakats added 2 commits March 6, 2026 04:20
- also query `INTERFACE_COMPILE_DEFINITIONS` and
  `INTERFACE_COMPILE_OPTIONS`. For correctness, at the moment they are
  not likely to pick up new options.
  Further syncing clang-tidy manual command-lines with the compiler
  command-lines generated by CMake. In practice this adds `-I` options
  (via `INTERFACE_COMPILE_OPTIONS`) to the end of the command-line for
  dependency header directories. It does not change the outcome of
  clang-tidy runs.

- drop redundant `unset()`.

- rename local function to be more specific.

Follow-up to d9386a2 curl#20759
@vszakats vszakats closed this in 009facd Mar 6, 2026
@vszakats vszakats deleted the cm-clang-tidy-t branch March 6, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant