[PATCH] cmake: Error on invalid CMAKE_BUILD_TYPE

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 8 13:01:05 PDT 2015


On Sat, Aug 8, 2015 at 12:10 AM, Justin Bogner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Apparently if you make a typo in the argument to CMAKE_BUILD_TYPE, cmake
> silently accepts this but doesn't apply any particular build type to
> your build. For LLVM, this means you get a build that doesn't really
> make any sense - it's sort of a debug build with asserts disabled.
>
> I'm not really sure why cmake allows this at all and the attached patch
> is basically a horrible hack to avoid the issue, but I just spent an
> obscene amount of time debugging some bizarre behaviour I ran into
> because I set the build type to RelWithDebugInfo instead of
> RelWithDebInfo.
>
> Better suggestions welcome.
>

Personally, I think that "Invalid value for CMAKE_BUILD_TYPE:
${CMAKE_BUILD_TYPE}" would be a better message.

I recently ran into this myself (and luckily saw the warning from cmake
saying it was invalid and was going to default to something else), so I
like this idea very much.

LGTM (Ill let you decide on the wordsmithing).


>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150808/bb6b837e/attachment.html>


More information about the llvm-commits mailing list