-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add support for windows caching #306
Conversation
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
@@ -342,6 +346,29 @@ macro(_gz_setup_msvc) | |||
# TODO: What flags should be set for PROFILE and COVERAGE build types? | |||
# Is it even possible to generate those build types on Windows? | |||
|
|||
# Replace any higher warnings with our selected level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to mess with the CMAKE_{C/CXX}_
variables if possible (or not to do it more than we are currently doing). Would it work something like add_compile_options(${MSVC_WARNING_LEVEL})
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, in general, I agree. The issue here is that MSVC is really dumb about how it parses command line options, and if you have multiple warning switches, they can interact poorly. Simply appending a new warning level to the end causes warnings to show up on the command line (iirc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning level bit is actually separate from the caching support here. It's just to suppress that warning with MSVC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning level bit is actually separate from the caching support here. It's just to suppress that warning with MSVC
The comment was looking to avoid messing with CMAKE_{C/CXX}_
for the warnings and for the optimization in the lines after. If you have already tested and suffer the multiple compile line options, I'm fine just by adding a comment before the CMAKE_{C/CXX}_
lines explaining why we are not usingadd_compile_options
.
@osrf-jenkins run tests please |
🦟 Bug fix
Summary
Using ccache or buildcache on Windows is not supported when using the
/Zi
flag (ref: ccache/ccache#1040)The recommended guidance at the moment is to drop to
/Z7
to allow for shared caches to work correctly.Enabled via:
USE_GZ_RECOMMENDED_MSVC_CACHING
and off by default.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.