[PATCH] D124153: [CMake] Change default CMAKE_BUILD_TYPE to Release

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 05:36:51 PDT 2022


aaron.ballman added a comment.

In D124153#3465133 <https://reviews.llvm.org/D124153#3465133>, @aaronpuchert wrote:

> In D124153#3464965 <https://reviews.llvm.org/D124153#3464965>, @mehdi_amini wrote:
>
>> If we can't resolve the targeted audience, what about erroring out when `CMAKE_BUILD_TYPE` isn't defined?
>
> Not sure if that could cause issues for multi-configuration users (if that's at all possible in LLVM), maybe @aaron.ballman can chime in (assuming that you use the Visual Studio generator)?

I'd have to test against the patch that turns it into an error to know for sure. I predominately use the MSVC built-in cmake support these days, and that has a separate way to set `CMAKE_BUILD_TYPE` that always defaults to *something* as best I can tell (it seems to set it to Debug, but I don't know if that's because of our CMake settings or not). So I wouldn't think this would be an issue if we went this route.

Personally, I think the default depends entirely on who is doing the download and from where. If people are doing a `git clone` of the `main` branch, I think they're more often developers and would want a debug build and switching to release will be a burden/surprise/annoyance. If they're snagging source from the release downloads page, they're probably not doing active development with that and would want a release build of some kind and the current behavior is a burden/surprise/annoyance. Without some measurements of how users are getting to the source in the first place, I don't think we can reasonably pick a default for all situations and call it better than the current one. It'll just be different.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124153/new/

https://reviews.llvm.org/D124153



More information about the llvm-commits mailing list