llvm-project
438f8870 - [cmake] Make CMAKE_BUILD_TYPE=Release the default (#174520)

Commit
51 days ago
[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 / 350bdf9227ceb , 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.
Author
rnk rnk
Parents
Loading