Skip to content

[cmake] Check correctly for different flags. Do check twice -Wall #73144

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

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

drodriguez
Copy link
Contributor

check_cxx_compiler_flag caches its results for the same variable, since all the flags were using the same variable, only the first check was done, and the rest of the flags were just using the result of the first flag.

Make each of the check_cxx_compiler_flag use a different variable (by interpolating the flag name) and reorder the list of compiler flags to check. -Wall was added twice, and in the case of MSVC, the equivalent was added last.

It doesn't really seem to affect a lot of things.

@drodriguez drodriguez requested a review from Rostepher April 19, 2024 21:04
@drodriguez drodriguez requested a review from a team as a code owner April 19, 2024 21:04
@drodriguez
Copy link
Contributor Author

@swift-ci please test

@Rostepher Rostepher requested review from shahmishal and removed request for Rostepher April 19, 2024 21:06
@shahmishal shahmishal requested review from etcwilde and edymtt April 19, 2024 21:38
Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

LGTM

check_cxx_compiler_flag caches its results for the same variable, since
all the flags were using the same variable, only the first check was
done, and the rest of the flags were just using the result of the first
flag.

Make each of the check_cxx_compiler_flag use a different variable (by
interpolating the flag name) and reorder the list of compiler flags to
check. -Wall was added twice, and in the case of MSVC, the equivalent
was added last.

It doesn't really seem to affect a lot of things.
@drodriguez drodriguez force-pushed the cmake-support-flags branch from b53da41 to 892aa71 Compare April 19, 2024 21:50
@drodriguez
Copy link
Contributor Author

@swift-ci please test

@drodriguez drodriguez merged commit a7ff815 into swiftlang:main Apr 22, 2024
@drodriguez drodriguez deleted the cmake-support-flags branch April 22, 2024 15:41
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.

2 participants