summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2023-01-06 15:19:56 +0100
committerSlávek Banko <[email protected]>2023-01-06 15:19:56 +0100
commit1d30924b9dd0740b726ae10b0aa4e6b6a6ea213a (patch)
treeb6a00ca5603dc039522f4ee4ca514e296a4c27aa
parentb92a3b0a4eb3cf0790904121c803717ebbbabd55 (diff)
downloadsip4-tqt-1d30924b9dd0740b726ae10b0aa4e6b6a6ea213a.tar.gz
sip4-tqt-1d30924b9dd0740b726ae10b0aa4e6b6a6ea213a.zip
Automatically add build definition Py_DEBUG, when building module for debug build of Python.
Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r--siputils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/siputils.py b/siputils.py
index e17518d..6abc6b1 100644
--- a/siputils.py
+++ b/siputils.py
@@ -856,6 +856,13 @@ class Makefile:
cppflags = []
+ if getattr(sys, "pydebug", False):
+ cppflags.append("-DPy_DEBUG")
+
+ if hasattr(sys, "abiflags"):
+ if 'd' in sys.abiflags:
+ cppflags.append("-DPy_DEBUG")
+
if not self._debug:
cppflags.append("-DNDEBUG")