diff options
author | Elvis Pranskevichus <elvis@magic.io> | 2020-04-22 17:58:50 -0700 |
---|---|---|
committer | Elvis Pranskevichus <elvis@magic.io> | 2020-04-22 18:07:53 -0700 |
commit | 60252260070137dd75f09d99a50c5dc624dea439 (patch) | |
tree | a6296dd37ef00286a1d0945812ed77276759516d /setup.py | |
parent | d107c3ea800d206ef890cafa81a8520aa29c5eb1 (diff) | |
download | immutables-60252260070137dd75f09d99a50c5dc624dea439.tar.gz immutables-60252260070137dd75f09d99a50c5dc624dea439.zip |
Define NDEBUG actively
`NDEBUG` is not defined by the standard library or the compiler by
default, so make sure it's defined when building non-debug builds.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -18,20 +18,23 @@ with open(os.path.join( break else: raise RuntimeError( - 'unable to read the version from immutables/__init__.py') + 'unable to read the version from immutables/_version.py') if platform.python_implementation() == 'CPython': if os.environ.get("DEBUG_IMMUTABLES") == '1': - undef_macros = ["NDEBUG"] + define_macros = [] + undef_macros = ['NDEBUG'] else: - undef_macros = None + define_macros = [('NDEBUG', '1')] + undef_macros = [] ext_modules = [ setuptools.Extension( "immutables._map", ["immutables/_map.c"], extra_compile_args=CFLAGS, + define_macros=define_macros, undef_macros=undef_macros) ] else: |