Skip to content

Commit fb1761b

Browse files
rgommersFFY00
authored andcommitted
ENH: set NDEBUG for release builds
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)
1 parent 6d96b3e commit fb1761b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mesonpy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ def _configure(self, reconfigure: bool = False) -> None:
851851
f'--native-file={os.fspath(self._meson_native_file)}',
852852
# TODO: Allow configuring these arguments
853853
'-Ddebug=false',
854+
'-Db_ndebug=if-release',
854855
'-Doptimization=2',
855856

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

0 commit comments

Comments
 (0)