Skip to content

Commit

Permalink
Set debug another way
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlees committed Mar 16, 2024
1 parent 3897e51 commit f81b618
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit f81b618

Please sign in to comment.