From 0028bac2975e9cfd68ce39e908d1fc923e94000b Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Thu, 2 Jul 2015 11:58:14 +0300 Subject: [PATCH] Added a flag to enable debug info generation on Windows. --- build.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index 46ac3ec..5e42ff1 100644 --- a/build.py +++ b/build.py @@ -52,6 +52,7 @@ PYTHON_INCLUDE_DIRECTORY = sysconfig.get_config_var('INCLUDEPY') S_EA64 = 'ea64' S_WITH_HEXRAYS = 'with-hexrays' S_NO_OPT = 'no-opt' +S_DEBUG = 'debug' # Swig command-line parameters 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 ea64 = '--' + S_EA64 in sys.argv with_hexrays = '--' + S_WITH_HEXRAYS in sys.argv + debug = '--' + S_DEBUG in sys.argv return { S_EA64: ea64, 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" SWIG_OPTIONS += " -D__NT__ " 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" # Platform-specific settings for the Mac OS X build elif platform == "macosx": @@ -577,6 +583,9 @@ def main(): elif '--doc' in sys.argv: return gen_docs(z = '--zip' in sys.argv) + if '--debug' in sys.argv: + debug = True + # Parse options options = parse_options(sys.argv) ea64 = options[S_EA64]