Skip to content

Commit

Permalink
ENH: set NDEBUG for release builds
Browse files Browse the repository at this point in the history
NDEBUG is normally expected to be set for release builds, however
for historical reasons Meson does not (yet) toggle `NDEBUG` for
non-debug builds (which we already default to). So set this as the
default. Choosing 'if-release' so that if users are explicitly
asking for a debug build via config-settings, they don't see a change
in behavior.

xref numpy/numpy#22546 (comment)
  • Loading branch information
rgommers authored and FFY00 committed Mar 10, 2023
1 parent 6d96b3e commit fb1761b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ def _configure(self, reconfigure: bool = False) -> None:
f'--native-file={os.fspath(self._meson_native_file)}',
# TODO: Allow configuring these arguments
'-Ddebug=false',
'-Db_ndebug=if-release',
'-Doptimization=2',

# XXX: This should not be needed, but Meson is using the wrong paths
Expand Down

0 comments on commit fb1761b

Please sign in to comment.