diff options
Diffstat (limited to 'Source/Modules/main.cxx')
-rw-r--r-- | Source/Modules/main.cxx | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 833394b9c..aa0d7d589 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -50,6 +50,7 @@ int SwigRuntime = 0; // 0 = no option, 1 = -runtime, 2 = -noruntime extern "C" { extern String *ModuleName; extern int ignore_nested_classes; + extern int kwargs_supported; } /* usage string split into multiple parts otherwise string is too big for some compilers */ @@ -62,6 +63,8 @@ static const char *usage1 = (const char *) "\ -co <file> - Check <file> out of the SWIG library\n\ -copyctor - Automatically generate copy constructors wherever possible\n\ -cpperraswarn - Treat the preprocessor #error statement as #warning (default)\n\ + -cppext <ext> - Change file extension of generated C++ files to <ext>\n\ + (default is cxx, except for PHP which uses cpp)\n\ -copyright - Display copyright notices\n\ -debug-classes - Display information about the classes found in the interface\n\ -debug-module <n>- Display module parse tree at stages 1-4, <n> is a csv list of stages\n\ @@ -79,6 +82,9 @@ static const char *usage1 = (const char *) "\ -directors - Turn on director mode for all the classes, mainly for testing\n\ -dirprot - Turn on wrapping of protected members for director classes (default)\n\ -D<symbol> - Define a symbol <symbol> (for conditional compilation)\n\ +"; + +static const char *usage2 = (const char *) "\ -E - Preprocess only, does not generate wrapper code\n\ -external-runtime [file] - Export the SWIG runtime stack\n\ -fakeversion <v>- Make SWIG fake the program version number to <v>\n\ @@ -86,9 +92,6 @@ static const char *usage1 = (const char *) "\ -features <list>- Set global features, where <list> is a comma separated list of\n\ features, eg -features directors,autodoc=1\n\ If no explicit value is given to the feature, a default of 1 is used\n\ -"; - -static const char *usage2 = (const char *) "\ -fastdispatch - Enable fast dispatch mode to produce faster overload dispatcher code\n\ -Fmicrosoft - Display error/warning messages in Microsoft format\n\ -Fstandard - Display error/warning messages in commonly used format\n\ @@ -100,6 +103,9 @@ static const char *usage2 = (const char *) "\ -importall - Follow all #include statements as imports\n\ -includeall - Follow all #include statements\n\ -l<ifile> - Include SWIG library file <ifile>\n\ +"; + +static const char *usage3 = (const char *) "\ -macroerrors - Report errors inside macros\n\ -makedefault - Create default constructors/destructors (the default)\n\ -M - List all dependencies\n\ @@ -119,10 +125,10 @@ static const char *usage2 = (const char *) "\ -noexcept - Do not wrap exception specifiers\n\ -nofastdispatch - Disable fast dispatch mode (default)\n\ -nopreprocess - Skip the preprocessor step\n\ + -notemplatereduce - Disable reduction of the typedefs in templates\n\ "; -static const char *usage3 = (const char *) "\ - -notemplatereduce - Disable reduction of the typedefs in templates\n\ +static const char *usage4 = (const char *) "\ -O - Enable the optimization options: \n\ -fastdispatch -fvirtual \n\ -o <outfile> - Set name of the output file to <outfile>\n\ @@ -677,6 +683,15 @@ void SWIG_getoptions(int argc, char *argv[]) { } else if (strcmp(argv[i], "-nocpperraswarn") == 0) { Preprocessor_error_as_warning(0); Swig_mark_arg(i); + } else if (strcmp(argv[i], "-cppext") == 0) { + Swig_mark_arg(i); + if (argv[i + 1]) { + SWIG_config_cppext(argv[i + 1]); + Swig_mark_arg(i + 1); + i++; + } else { + Swig_arg_error(); + } } else if ((strcmp(argv[i], "-debug-typemap") == 0) || (strcmp(argv[i], "-debug_typemap") == 0) || (strcmp(argv[i], "-tm_debug") == 0)) { tm_debug = 1; Swig_mark_arg(i); @@ -850,6 +865,7 @@ void SWIG_getoptions(int argc, char *argv[]) { fputs(usage1, stdout); fputs(usage2, stdout); fputs(usage3, stdout); + fputs(usage4, stdout); Swig_mark_arg(i); help = 1; } @@ -904,6 +920,8 @@ int SWIG_main(int argc, char *argv[], Language *l) { // Inform the parser if the nested classes should be ignored unless explicitly told otherwise via feature:flatnested ignore_nested_classes = l->nestedClassesSupport() == Language::NCS_Unknown ? 1 : 0; + kwargs_supported = l->kwargsSupport() ? 1 : 0; + // Create Library search directories // Check for SWIG_LIB environment variable @@ -1172,6 +1190,7 @@ int SWIG_main(int argc, char *argv[], Language *l) { Printf(stdout, "Processing unnamed structs...\n"); Swig_nested_name_unnamed_c_structs(top); } + Swig_extend_unused_check(); if (Verbose) { Printf(stdout, "Processing types...\n"); |