Skip to content

Don't warn on missing clang-format/tidy when disabled#1191

Merged
isaacbrodsky merged 1 commit into
uber:masterfrom
xxxxxxjun:fix/cmake-warning-on-disabled-option
Jul 19, 2026
Merged

Don't warn on missing clang-format/tidy when disabled#1191
isaacbrodsky merged 1 commit into
uber:masterfrom
xxxxxxjun:fix/cmake-warning-on-disabled-option

Conversation

@xxxxxxjun

Copy link
Copy Markdown
Contributor

Fixes #1158.

cmake_dependent_option forces ENABLE_FORMAT/ENABLE_LINTING to OFF
when the tool is missing, so the existing elseif(NOT CLANG_FORMAT_PATH)
can't tell an explicit OFF from a missing tool and warns in both cases.

Changes:

  • Record whether the user set the option to OFF before
    cmake_dependent_option runs, and only warn when they didn't.
  • Drop a redundant option(ENABLE_LINTING ...) that the following
    cmake_dependent_option immediately overrode.

Verified by configuring with the tool present and missing:

  • missing, default: warns (unchanged)
  • missing, OFF: no warning (the fix), including on reconfigure
  • missing, ON: warns (unchanged)
  • present: no warning (unchanged)

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 99.176%. remained the same — xxxxxxjun:fix/cmake-warning-on-disabled-option into uber:master

@isaacbrodsky
isaacbrodsky merged commit 8a964f5 into uber:master Jul 19, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undesired CMake warning message on option deactivation

4 participants