Provide -cppext as a general command line option
Provide -cppext as a general command line option for setting the extension used for generated C++ files (previously it was specific to the PHP backend). Deprecate the equivalent -suffix option provided by the Ocaml backend, but continue to support that for now.
This commit is contained in:
parent
0acebe2289
commit
cd16059c66
5 changed files with 20 additions and 11 deletions
|
|
@ -63,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\
|
||||
|
|
@ -681,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);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ static const char *usage = "\
|
|||
Ocaml Options (available with -ocaml)\n\
|
||||
-oldvarnames - Old intermediary method names for variable wrappers\n\
|
||||
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
|
||||
-suffix <name> - Change .cxx to something else\n\
|
||||
-suffix <name> - Deprecated alias for general option -cppext\n\
|
||||
-where - Emit library location\n\
|
||||
\n";
|
||||
|
||||
|
|
@ -114,6 +114,7 @@ public:
|
|||
}
|
||||
} else if (strcmp(argv[i], "-suffix") == 0) {
|
||||
if (argv[i + 1]) {
|
||||
Printf(stderr, "swig: warning: -suffix option deprecated. SWIG 3.0.4 and later provide a -cppext option which should be used instead.\n");
|
||||
SWIG_config_cppext(argv[i + 1]);
|
||||
Swig_mark_arg(i);
|
||||
Swig_mark_arg(i + 1);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
|
||||
static const char *usage = "\
|
||||
PHP Options (available with -php)\n\
|
||||
-cppext <ext> - Change C++ file extension to <ext> (default is cpp)\n\
|
||||
-noproxy - Don't generate proxy classes.\n\
|
||||
-prefix <prefix> - Prepend <prefix> to all class names in PHP wrappers\n\
|
||||
\n";
|
||||
|
|
@ -221,15 +220,6 @@ public:
|
|||
} else {
|
||||
Swig_arg_error();
|
||||
}
|
||||
} else if (strcmp(argv[i], "-cppext") == 0) {
|
||||
if (argv[i + 1]) {
|
||||
SWIG_config_cppext(argv[i + 1]);
|
||||
Swig_mark_arg(i);
|
||||
Swig_mark_arg(i + 1);
|
||||
i++;
|
||||
} else {
|
||||
Swig_arg_error();
|
||||
}
|
||||
} else if ((strcmp(argv[i], "-noshadow") == 0) || (strcmp(argv[i], "-noproxy") == 0)) {
|
||||
shadow = 0;
|
||||
Swig_mark_arg(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue