Added a flag to enable debug info generation on Windows.

This commit is contained in:
Tamir Bahar 2015-07-02 11:58:14 +03:00
parent a2c4f50f31
commit 0028bac297

View File

@ -52,6 +52,7 @@ PYTHON_INCLUDE_DIRECTORY = sysconfig.get_config_var('INCLUDEPY')
S_EA64 = 'ea64' S_EA64 = 'ea64'
S_WITH_HEXRAYS = 'with-hexrays' S_WITH_HEXRAYS = 'with-hexrays'
S_NO_OPT = 'no-opt' S_NO_OPT = 'no-opt'
S_DEBUG = 'debug'
# Swig command-line parameters # Swig command-line parameters
SWIG_OPTIONS = '-modern -python -threads -c++ -w451 -shadow -D__GNUC__' SWIG_OPTIONS = '-modern -python -threads -c++ -w451 -shadow -D__GNUC__'
@ -170,11 +171,13 @@ def parse_options(args):
no_opt = '--' + S_NO_OPT in sys.argv no_opt = '--' + S_NO_OPT in sys.argv
ea64 = '--' + S_EA64 in sys.argv ea64 = '--' + S_EA64 in sys.argv
with_hexrays = '--' + S_WITH_HEXRAYS in sys.argv with_hexrays = '--' + S_WITH_HEXRAYS in sys.argv
debug = '--' + S_DEBUG in sys.argv
return { return {
S_EA64: ea64, S_EA64: ea64,
S_WITH_HEXRAYS: with_hexrays, S_WITH_HEXRAYS: with_hexrays,
S_NO_OPT: no_opt S_NO_OPT: no_opt,
S_DEBUG: debug
} }
# ----------------------------------------------------------------------- # -----------------------------------------------------------------------
@ -374,7 +377,10 @@ def build_plugin(
ida_lib = "ida.lib" ida_lib = "ida.lib"
SWIG_OPTIONS += " -D__NT__ " SWIG_OPTIONS += " -D__NT__ "
extra_link_parameters = "" extra_link_parameters = ""
if not options[S_NO_OPT]: if options[S_DEBUG]:
builder.compiler_parameters += " /Zi"
builder.linker_parameters += " /DEBUG"
if not options[S_NO_OPT] and not options[S_DEBUG]:
builder.compiler_parameters += " -Ox" builder.compiler_parameters += " -Ox"
# Platform-specific settings for the Mac OS X build # Platform-specific settings for the Mac OS X build
elif platform == "macosx": elif platform == "macosx":
@ -577,6 +583,9 @@ def main():
elif '--doc' in sys.argv: elif '--doc' in sys.argv:
return gen_docs(z = '--zip' in sys.argv) return gen_docs(z = '--zip' in sys.argv)
if '--debug' in sys.argv:
debug = True
# Parse options # Parse options
options = parse_options(sys.argv) options = parse_options(sys.argv)
ea64 = options[S_EA64] ea64 = options[S_EA64]