Add option to enforce build-time code analysis for VS projects #2190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This is a follow up to a previous PR: #2187
After enabling clang-tidy as an option in the VS IDE (#2187), this patch allows us to enforce it at build time. This can significantly increase build time, as you would expect from any static analysis tool. When building VS projects using this option, along with #2187, the log will show:
A few people have asked for compile_command.json generation. On Linux/Macos, tools exist to generate this (e.g.
bear
etc). This is tricky on windows. As an extra side-benefit of this change, as seen in the log above, a compile_commands.json file is generated in the location specified with the-p
flag. However, while useful, this is a side-effect of this change and not its primary purpose.How does this PR change Premake's behavior?
Add configuration-scoped option
runcodeanalysis
for Visual Studio 2019 and above.Did you check all the boxes?
closes #XXXX
in comment to auto-close issue when PR is merged)