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

Fix unknown c++ flag detection in CMake #2057

Closed
wants to merge 1 commit into from

Conversation

cyyever
Copy link
Contributor

@cyyever cyyever commented Oct 3, 2023

Unknown -Wno-XXX flags are still appended to GCC via append_cxx_flag_if_supported because of the behavior mentioned in GCC document:

When an unrecognized warning option is requested (e.g., -Wunknown-warning),
GCC emits a diagnostic stating that the option is not recognized.
However, if the -Wno- form is used, the behavior is slightly different:
no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced.
This allows the use of new -Wno- options with old compilers,
but if something goes wrong, the compiler warns that an unrecognized option is present.

This PR tries to fix by detection the flag of the -WXXX form. The same patch was applied in PyTorch.

@netlify
Copy link

netlify bot commented Oct 3, 2023

Deploy Preview for pytorch-fbgemm-docs canceled.

Name Link
🔨 Latest commit eec5be7
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/651e0164d7a38d00089fd536

@facebook-github-bot
Copy link
Contributor

@q10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@q10 merged this pull request in 17384a9.

@cyyever cyyever deleted the warning_detect branch October 5, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants