CMake warn when non-release build#742
Conversation
|
@otbrown Any objections to this idea? (I worry about adding warnings to the build process generally). This will not affect single-config (i.e. MacOS / Linux) users who leave In contrast, multi-config users (e.g. wretched Windows users) will always see a message at config time, reminding them to subsequently build with It's my opinion this is all good/fine, but making sure as a CMake noobie! |
|
The spirit is fine! I'm just looking at config generators which should let us do it more neatly and capture both single and multiconfig users (although isn't actually working when tested currently...). I'll push an alternative version using that if I can get it working, if not, squash and merge! |
|
Okay, after some footering around I have concluded that Generator expressions will not help here. I will update to include |
…ity and prevent erroneous warning on relwithdebinfo
|
@TysonRayJones ignoring my naive and failed attempt to suppress the stupid EOF diff, which I suspect is a LF/CRLF issue: I have added something to deal with case insensitivity of CMAKE_BUILD_TYPE and included In theory we ought to do something similar where we check the build type before adding Edit: I had broken it 🤦♂️ should be fixed now |
|
Good catches! Confirmed everything looks good in manual testing on Windows and Mac 🎉 |
Warn users about potential performance loss when not explicitly specifying
Release, and especially when using a multi-config generator which requires build-type specification (as per the doc) - since this just bit me pretty bad on Windows! 😠