Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always define 'format' target #3371

Merged
merged 1 commit into from Jun 28, 2021
Merged

Conversation

mkindahl
Copy link
Contributor

If clang-format is not found CLANG_FORMAT will be set to a false
value, which will prevent the format target from being defined if
cmake-format is not installed.

This commit fixes that by always creating a format target since
clang-format is always created even if CLANG_FORMAT is false.

We do not redefine CLANG_FORMAT to a non-false value since it is
expected to contain a path to an executable and if set to a true value
that is not a path it could be used in a way that leads to strange
errors.

@mkindahl mkindahl self-assigned this Jun 28, 2021
@mkindahl mkindahl requested a review from a team as a code owner June 28, 2021 11:59
@mkindahl mkindahl requested review from afiskon, nikkhils and svenklemm and removed request for a team June 28, 2021 11:59
CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@nikkhils nikkhils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

CMakeLists.txt Outdated Show resolved Hide resolved
If `clang-format` is not found `CLANG_FORMAT` will be set to a false
value, which will prevent the `format` target from being defined if
`cmake-format` is not installed.

This commit fixes that by always creating a `format` target since
`clang-format` is always created even if `CLANG_FORMAT` is false.

We do not redefine `CLANG_FORMAT` to a non-false value since it is
expected to contain a path to an executable and if set to a true value
that is not a path it could be used in a way that leads to strange
errors.
@mkindahl mkindahl merged commit a3e8fd0 into timescale:master Jun 28, 2021
@mkindahl mkindahl deleted the fix_format_target branch June 28, 2021 16:26
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.

None yet

4 participants