Commit 438f887
authored
[cmake] Make CMAKE_BUILD_TYPE=Release the default (#174520)
Currently, we report a fatal error if the user leaves CMAKE_BUILD_TYPE
blank. This was implemented in https://reviews.llvm.org/D124153 /
350bdf9 , based on this RFC:
https://discourse.llvm.org/t/rfc-select-a-better-linker-by-default-or-warn-about-using-bfd/61899/1
Tom Stellard mentioned that he'd like to revisit this on Discord, and
Aiden, myself, and apparently most people on the original RFC agree, so
I'm proposing we do it. However, on the review, several folks objected
and insisted that Debug was a better default. I want to reopen the
question.
I think we've made the wrong tradeoff. I wish Debug builds worked out of
the box on most systems, but they don't, and LLVM has only gotten bigger
over the last four years, making the build scalability problems of Debug
builds worse. I think we should optimize our build configuration for new
developers, not experienced longtime contributors who are invested
enough to tweak the build to their liking.
With this PR, we emit a warning, and set the build type to Release,
which has a higher likelihood of success for first-time users. Making
the build work out of the box is very important for making LLVM
development more accessible to new contributors, so it seems worth
smoothing over this rough edge.
A separate possible improvement would be to set
LLVM_ENABLE_ASSERTIONS=ON, but that is out of scope for this PR.1 parent 2329d04 commit 438f887
1 file changed
+3
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 82 | + | |
| 83 | + | |
90 | 84 | | |
| 85 | + | |
91 | 86 | | |
92 | 87 | | |
93 | 88 | | |
| |||
0 commit comments