Fix up the build_debug so that it removes 'NDEBUG' from the CFLAGS

This commit is contained in:
Andrew Resch 2010-01-23 22:33:24 +00:00
parent 30280b0803
commit 9b26f6ebee
1 changed files with 15 additions and 12 deletions

View File

@ -99,19 +99,20 @@ if windows_check():
else: else:
_extra_compile_args += ["-Wno-missing-braces"] _extra_compile_args += ["-Wno-missing-braces"]
removals = ["-Wstrict-prototypes"] def remove_from_cflags(flags):
if not windows_check():
if not windows_check(): keys = ["OPT", "CFLAGS"]
if python_version == '2.5': if python_version == '2.5':
cv_opt = sysconfig.get_config_vars()["CFLAGS"] keys = ["CFLAGS"]
for removal in removals:
cv_opt = cv_opt.replace(removal, " ") for key in keys:
sysconfig.get_config_vars()["CFLAGS"] = " ".join(cv_opt.split()) cv_opt = sysconfig.get_config_vars()[key]
else: for flag in flags:
cv_opt = sysconfig.get_config_vars()["OPT"] cv_opt = cv_opt.replace(flag, " ")
for removal in removals: sysconfig.get_config_vars()[key] = " ".join(cv_opt.split())
cv_opt = cv_opt.replace(removal, " ")
sysconfig.get_config_vars()["OPT"] = " ".join(cv_opt.split()) removals = ["-Wstrict-prototypes"]
remove_from_cflags(removals)
_library_dirs = [ _library_dirs = [
] ]
@ -332,6 +333,8 @@ class build_ext_debug(_build_ext):
lt_ext.extra_compile_args.remove('-DNDEBUG') lt_ext.extra_compile_args.remove('-DNDEBUG')
lt_ext.extra_compile_args.remove('-O2') lt_ext.extra_compile_args.remove('-O2')
lt_ext.extra_compile_args.append('-g')
remove_from_cflags(["-DNDEBUG"])
return _build_ext.run(self) return _build_ext.run(self)
class clean_plugins(cmd.Command): class clean_plugins(cmd.Command):