From f81b618a34ce1145d0427f2bf7322321be39f565 Mon Sep 17 00:00:00 2001 From: John Lees Date: Sat, 16 Mar 2024 16:58:56 +0000 Subject: [PATCH] Set debug another way --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 574455f5..badd648c 100755 --- a/setup.py +++ b/setup.py @@ -77,8 +77,7 @@ def build_extension(self, ext): env = os.environ.copy() env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''), self.distribution.get_version()) - if cfg == 'Debug': - env['CXXFLAGS'] += "-DDEBUG" + if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) @@ -91,8 +90,11 @@ def build_extension(self, ext): subprocess.check_call(['make', 'python'], cwd=ext.sourcedir + '/src', env=env) subprocess.check_call(['make', 'install_python', 'PYTHON_LIB_PATH=' + extdir], cwd=ext.sourcedir + '/src', env=env) elif target == 'jlees': - subprocess.check_call(['make', '-f', 'Makefile_fedora38', 'python'], cwd=ext.sourcedir + '/src', env=env) - subprocess.check_call(['make', 'install_python', 'PYTHON_LIB_PATH=' + extdir], cwd=ext.sourcedir + '/src', env=env) + debug = "DEBUG=0" + if cfg == 'Debug': + debug = "DEBUG=1" + subprocess.check_call(['make', '-f', 'Makefile_fedora38', 'python', debug], cwd=ext.sourcedir + '/src', env=env) + subprocess.check_call(['make', 'install_python', 'PYTHON_LIB_PATH=' + extdir, debug], cwd=ext.sourcedir + '/src', env=env) else: subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env) subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)