Meson: Enable NDEBUG by default in release builds?

Created on 1 Nov 2017  路  5Comments  路  Source: mesonbuild/meson

1896 adds a new option for b_ndebug that would automatically define it for release builds. There's also some discussion if this should just be the default, but the PR doesn't touch that, so I thought that discussion could be continued in its own issue.

Summary:

  • It's also what CMake does
  • NDEBUG is a C/C++ standard
  • Would make #1896 obsolete (or build upon it)
  • Some distros don't like it enabled by default; why?
enhancement

Most helpful comment

I would be in favour of this.

All 5 comments

I'd imagine most distros use the plain build type and specify their own build flags. Changing the default behaviour of release builds thus shouldn't affect them.

I would be in favour of this.

This changes what most people would expect, namely that _release_ binaries don't contain any assert()s anymore, so I am very much in favour of this too.

Except... there are many people who also keep assert() enabled in release builds.

I guess, however, I fall into the "plain" camp and pick my own flags in this case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SilverRainZ picture SilverRainZ  路  5Comments

arteymix picture arteymix  路  3Comments

ignatenkobrain picture ignatenkobrain  路  4Comments

Ericson2314 picture Ericson2314  路  4Comments

sarum9in picture sarum9in  路  3Comments