From d107c3ea800d206ef890cafa81a8520aa29c5eb1 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Wed, 22 Apr 2020 17:03:48 -0700 Subject: A bunch of fixes * Fix #26: `ifdef NDEBUG` should be `ifndef NDEBUG` * More tests for #24 * Add a `DEBUG_IMMUTABLES` env var to build debug builds --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e27586c..3749742 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -import os.path +import os import platform import setuptools @@ -22,11 +22,17 @@ with open(os.path.join( if platform.python_implementation() == 'CPython': + if os.environ.get("DEBUG_IMMUTABLES") == '1': + undef_macros = ["NDEBUG"] + else: + undef_macros = None + ext_modules = [ setuptools.Extension( "immutables._map", ["immutables/_map.c"], - extra_compile_args=CFLAGS) + extra_compile_args=CFLAGS, + undef_macros=undef_macros) ] else: ext_modules = [] -- cgit v1.2.3