[PATCH] D26579: [cmake] Allow CMAKE_BUILD_TYPE=Gentoo

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 12 14:32:03 PST 2016


beanz added a comment.

The justification of controlling the compiler options is weak to me. At Apple we want to tightly control the flags that are added to the build as well. We do it by setting `CMAKE_BUILD_TYPE=RelWithDebInfo`, then overriding `CMAKE_<LANG>_FLAGS_RELWITHDEBINFO` to ensure CMake doesn't add anything strange. Then we use LLVM options to enable and disable the features that add flags to get the build the way we want.

Why is this insufficient for Gentoo? I can understand that it may take time to craft, but it doesn't impose extra maintenance on the LLVM community, which is desirable. Making our CMake allow non-standard values for standard settings is confusing and I think should be avoided.

Please keep in mind CMake's documentation explicitly says:

> Possible values are empty, Debug, Release, RelWithDebInfo and MinSizeRel.

(https://cmake.org/cmake/help/v3.4/variable/CMAKE_BUILD_TYPE.html)

In the LLVM build we disallowed empty by forcing it to Debug because it causes our build to behave incorrectly (which I could probably be convinced we should fix), but I really don't see a reason we should add a new type.


https://reviews.llvm.org/D26579





More information about the llvm-commits mailing list