Skip to content

[CMake] Make specifying invalid build type a fatal error #72021

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

Conversation

boomanaiden154
Copy link
Contributor

This patch makes it so that specifying an invalid value for CMAKE_BUILD_TYPE is a fatal error. Having this simply as a warning has caused me (and probably others) a decent amount of headache. The check was present before, but was proposed to be modified to a warning in #60975 and changed to a warning in c75dbed. This patch reenables that behavior to hopefully reduce frustration for people building LLVM in the common case while still allowing for alternative build types to be setup without needing to perform source modification through the addition of a CMake flag.

This patch makes it so that specifying an invalid value for
CMAKE_BUILD_TYPE is a fatal error. Having this simply as a warning has
caused me (and probably others) a decent amount of headache. The check
was present before, but was proposed to be modified to a warning in
llvm#60975 and changed to a
warning in c75dbed. This patch
reenables that behavior to hopefully reduce frustration for people
building LLVM in the common case while still allowing for alternative
build types to be setup without needing to perform source modification
through the addition of a CMake flag.
@boomanaiden154
Copy link
Contributor Author

Pinging @rossburton on this as he was the original author of the issue.

@rossburton
Copy link

That's acceptable to me at least - we can just allow the extra types.

Copy link
Member

@fsb4000 fsb4000 left a comment

Choose a reason for hiding this comment

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

Yes. Looks good. Warnings could be often ignored and we can define LLVM_ADDITIONAL_BUILD_TYPES if we need custom build type.

@boomanaiden154
Copy link
Contributor Author

Thanks for the reviews and the compromise here!

@boomanaiden154 boomanaiden154 merged commit f49bca9 into llvm:main Nov 16, 2023
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
This patch makes it so that specifying an invalid value for
CMAKE_BUILD_TYPE is a fatal error. Having this simply as a warning has
caused me (and probably others) a decent amount of headache. The check
was present before, but was proposed to be modified to a warning in
llvm#60975 and changed to a
warning in c75dbed. This patch
reenables that behavior to hopefully reduce frustration for people
building LLVM in the common case while still allowing for alternative
build types to be setup without needing to perform source modification
through the addition of a CMake flag.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
This patch makes it so that specifying an invalid value for
CMAKE_BUILD_TYPE is a fatal error. Having this simply as a warning has
caused me (and probably others) a decent amount of headache. The check
was present before, but was proposed to be modified to a warning in
llvm#60975 and changed to a
warning in c75dbed. This patch
reenables that behavior to hopefully reduce frustration for people
building LLVM in the common case while still allowing for alternative
build types to be setup without needing to perform source modification
through the addition of a CMake flag.
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.

3 participants