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

Support for C in tools.cmake #46

Closed
cconverse711 opened this issue Jul 20, 2023 · 3 comments
Closed

Support for C in tools.cmake #46

cconverse711 opened this issue Jul 20, 2023 · 3 comments

Comments

@cconverse711
Copy link

All the tools in tools.cmake are currently applied to only C++ code, however they all support C code as well. Supporting C should just be a fairly straightforward -- for example setting the CMAKE_C_CLANG_TIDY to match CMAKE_CXX_CLANG_TIDY

@StableCoder
Copy link
Owner

I committed c1a621a, which I think covers it. let me know if there's still an issue.

@cconverse711
Copy link
Author

Thank you, that looks good.

Though I am curious about the intended behavior of the cppcheck logic in tools.cmake. There's a if (CPPECHECK) check (note the typo) here that will evaluate to false due to the typo, however the logic inside that check's body is modifying the CMAKE_CXX_CPPCHECK variable with additional cppcheck flags. But when the cppcheck() macro is invoked, the CMAKE_CXX_CPPCHECK is overwritten and wipes out the cppcheck flags that were applied earlier. Are those flags supposed to persist, or is that an old approach for applying cppcheck flags that's no longer meant to be used?

@StableCoder
Copy link
Owner

Honestly, I'm not entirely sure anymore. Much of the implementation is several years old.

However, as you do note it was a bit confusing, so I've gone ahead and re-worked the implementation (ba83421), and hopefully made things much clearer.

I've gone fully down the road of giving better control of the tools to the calling scripts, and the ability to overwrite/clear flags at-will throughout.

Let me know if what it is now is still unclear, or what parts of it are, and I'll try to fix/make things even clearer.

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

No branches or pull requests

2 participants