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():
keys = ["OPT", "CFLAGS"]
if python_version == '2.5':
keys = ["CFLAGS"]
if not windows_check(): for key in keys:
if python_version == '2.5': cv_opt = sysconfig.get_config_vars()[key]
cv_opt = sysconfig.get_config_vars()["CFLAGS"] for flag in flags:
for removal in removals: cv_opt = cv_opt.replace(flag, " ")
cv_opt = cv_opt.replace(removal, " ") sysconfig.get_config_vars()[key] = " ".join(cv_opt.split())
sysconfig.get_config_vars()["CFLAGS"] = " ".join(cv_opt.split())
else: removals = ["-Wstrict-prototypes"]
cv_opt = sysconfig.get_config_vars()["OPT"] remove_from_cflags(removals)
for removal in removals:
cv_opt = cv_opt.replace(removal, " ")
sysconfig.get_config_vars()["OPT"] = " ".join(cv_opt.split())
_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):