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
|
|
@ -5,3 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 3.0.4 (in progress)
|
Version 3.0.4 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2015-01-08: olly
|
||||||
|
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.
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ can be obtained by typing <tt>swig -help</tt> or <tt>swig
|
||||||
-xml Generate XML wrappers
|
-xml Generate XML wrappers
|
||||||
|
|
||||||
-c++ Enable C++ parsing
|
-c++ Enable C++ parsing
|
||||||
|
-cppext <em>ext</em> Change file extension of C++ generated files to <em>ext</em> (default is cxx, except for PHP which uses cpp)
|
||||||
-D<em>symbol</em> Define a preprocessor symbol
|
-D<em>symbol</em> Define a preprocessor symbol
|
||||||
-Fstandard Display error/warning messages in commonly used format
|
-Fstandard Display error/warning messages in commonly used format
|
||||||
-Fmicrosoft Display error/warning messages in Microsoft format
|
-Fmicrosoft Display error/warning messages in Microsoft format
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@ static const char *usage1 = (const char *) "\
|
||||||
-co <file> - Check <file> out of the SWIG library\n\
|
-co <file> - Check <file> out of the SWIG library\n\
|
||||||
-copyctor - Automatically generate copy constructors wherever possible\n\
|
-copyctor - Automatically generate copy constructors wherever possible\n\
|
||||||
-cpperraswarn - Treat the preprocessor #error statement as #warning (default)\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\
|
-copyright - Display copyright notices\n\
|
||||||
-debug-classes - Display information about the classes found in the interface\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\
|
-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) {
|
} else if (strcmp(argv[i], "-nocpperraswarn") == 0) {
|
||||||
Preprocessor_error_as_warning(0);
|
Preprocessor_error_as_warning(0);
|
||||||
Swig_mark_arg(i);
|
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)) {
|
} else if ((strcmp(argv[i], "-debug-typemap") == 0) || (strcmp(argv[i], "-debug_typemap") == 0) || (strcmp(argv[i], "-tm_debug") == 0)) {
|
||||||
tm_debug = 1;
|
tm_debug = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ static const char *usage = "\
|
||||||
Ocaml Options (available with -ocaml)\n\
|
Ocaml Options (available with -ocaml)\n\
|
||||||
-oldvarnames - Old intermediary method names for variable wrappers\n\
|
-oldvarnames - Old intermediary method names for variable wrappers\n\
|
||||||
-prefix <name> - Set a prefix <name> to be prepended to all names\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\
|
-where - Emit library location\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
||||||
|
|
@ -114,6 +114,7 @@ public:
|
||||||
}
|
}
|
||||||
} else if (strcmp(argv[i], "-suffix") == 0) {
|
} else if (strcmp(argv[i], "-suffix") == 0) {
|
||||||
if (argv[i + 1]) {
|
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_config_cppext(argv[i + 1]);
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
Swig_mark_arg(i + 1);
|
Swig_mark_arg(i + 1);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@
|
||||||
|
|
||||||
static const char *usage = "\
|
static const char *usage = "\
|
||||||
PHP Options (available with -php)\n\
|
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\
|
-noproxy - Don't generate proxy classes.\n\
|
||||||
-prefix <prefix> - Prepend <prefix> to all class names in PHP wrappers\n\
|
-prefix <prefix> - Prepend <prefix> to all class names in PHP wrappers\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
@ -221,15 +220,6 @@ public:
|
||||||
} else {
|
} else {
|
||||||
Swig_arg_error();
|
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)) {
|
} else if ((strcmp(argv[i], "-noshadow") == 0) || (strcmp(argv[i], "-noproxy") == 0)) {
|
||||||
shadow = 0;
|
shadow = 0;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue