patch #1069631 to disable cpp
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6766 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1f0ebfd56a
commit
5b89ab2e60
1 changed files with 23 additions and 13 deletions
|
|
@ -82,6 +82,7 @@ static const char *usage2 = (const char*)"\
|
||||||
-nodirprot - Do not wrap director protected members\n\
|
-nodirprot - Do not wrap director protected members\n\
|
||||||
-noexcept - Do not wrap exception specifiers\n\
|
-noexcept - Do not wrap exception specifiers\n\
|
||||||
-noextern - Do not generate extern declarations\n\
|
-noextern - Do not generate extern declarations\n\
|
||||||
|
-nopreprocess - Skip the preprocessor step\n\
|
||||||
-o <outfile> - Set name of the output file to <outfile>\n\
|
-o <outfile> - Set name of the output file to <outfile>\n\
|
||||||
-oh <headfile> - Set name of the output header file to <headfile>\n\
|
-oh <headfile> - Set name of the output header file to <headfile>\n\
|
||||||
-outdir <dir> - Set language specific files output directory\n\
|
-outdir <dir> - Set language specific files output directory\n\
|
||||||
|
|
@ -108,6 +109,7 @@ static String *xmlout = 0;
|
||||||
static int help = 0;
|
static int help = 0;
|
||||||
static int checkout = 0;
|
static int checkout = 0;
|
||||||
static int cpp_only = 0;
|
static int cpp_only = 0;
|
||||||
|
static int no_cpp = 0;
|
||||||
static char *outfile_name = 0;
|
static char *outfile_name = 0;
|
||||||
static char *outfile_name_h = 0;
|
static char *outfile_name_h = 0;
|
||||||
static int tm_debug = 0;
|
static int tm_debug = 0;
|
||||||
|
|
@ -292,6 +294,9 @@ void SWIG_getoptions(int argc, char *argv[])
|
||||||
} else if (strcmp(argv[i],"-E") == 0) {
|
} else if (strcmp(argv[i],"-E") == 0) {
|
||||||
cpp_only = 1;
|
cpp_only = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
|
} else if (strcmp(argv[i],"-nopreprocess") == 0) {
|
||||||
|
no_cpp = 1;
|
||||||
|
Swig_mark_arg(i);
|
||||||
} else if ((strcmp(argv[i],"-verbose") == 0) ||
|
} else if ((strcmp(argv[i],"-verbose") == 0) ||
|
||||||
(strcmp(argv[i],"-v") == 0)) {
|
(strcmp(argv[i],"-v") == 0)) {
|
||||||
Verbose = 1;
|
Verbose = 1;
|
||||||
|
|
@ -721,21 +726,26 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
||||||
SWIG_exit (EXIT_FAILURE);
|
SWIG_exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
fclose(df);
|
fclose(df);
|
||||||
Printf(fs,"%%include <swig.swg>\n");
|
if(!no_cpp) {
|
||||||
if (allkw) {
|
Printf(fs,"%%include <swig.swg>\n");
|
||||||
Printf(fs,"%%include <allkw.swg>\n");
|
if (allkw) {
|
||||||
|
Printf(fs,"%%include <allkw.swg>\n");
|
||||||
|
}
|
||||||
|
if (lang_config) {
|
||||||
|
Printf(fs,"\n%%include <%s>\n", lang_config);
|
||||||
|
}
|
||||||
|
Printf(fs,"%%include \"%s\"\n", Swig_last_file());
|
||||||
|
for (i = 0; i < Len(libfiles); i++) {
|
||||||
|
Printf(fs,"\n%%include \"%s\"\n", Getitem(libfiles,i));
|
||||||
|
}
|
||||||
|
Seek(fs,0,SEEK_SET);
|
||||||
|
cpps = Preprocessor_parse(fs);
|
||||||
|
} else {
|
||||||
|
df = Swig_open(input_file);
|
||||||
|
cpps = NewFileFromFile(df);
|
||||||
}
|
}
|
||||||
if (lang_config) {
|
|
||||||
Printf(fs,"\n%%include <%s>\n", lang_config);
|
|
||||||
}
|
|
||||||
Printf(fs,"%%include \"%s\"\n", Swig_last_file());
|
|
||||||
for (i = 0; i < Len(libfiles); i++) {
|
|
||||||
Printf(fs,"\n%%include \"%s\"\n", Getitem(libfiles,i));
|
|
||||||
}
|
|
||||||
Seek(fs,0,SEEK_SET);
|
|
||||||
cpps = Preprocessor_parse(fs);
|
|
||||||
if (Swig_error_count()) {
|
if (Swig_error_count()) {
|
||||||
SWIG_exit(EXIT_FAILURE);
|
SWIG_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (cpp_only) {
|
if (cpp_only) {
|
||||||
Printf(stdout,"%s", cpps);
|
Printf(stdout,"%s", cpps);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue