pip_cmg include fix
This commit is contained in:
@@ -419,18 +419,22 @@ void makeGetterValue(PIFile & f, const PICodeParser::Entity * e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void writeModel(PICodeParser & parser, PICLI & cli, const PIString out, bool meta, bool enums, bool streams, bool texts, bool getters) {
|
void writeModel(PICodeParser & parser, PICLI & cli, const PIString out, const PIStringList & files, bool meta, bool enums, bool streams, bool texts, bool getters) {
|
||||||
PIString defname = "CCM_" + PIString::fromNumber(out.hash()) + "_H";
|
PIString defname = "CCM_" + PIString::fromNumber(out.hash()) + "_H";
|
||||||
PISet<PIString> inc_files;
|
PISet<PIString> inc_files;
|
||||||
piForeachC (PICodeParser::Entity * e, parser.entities)
|
piForeachC (PICodeParser::Entity * e, parser.entities)
|
||||||
if (e->name.find("::") < 0 && !e->name.startsWith("_PI"))
|
if (e->name.find("::") < 0 && !e->name.startsWith("_PI"))
|
||||||
inc_files << e->file;
|
inc_files << e->file;
|
||||||
PIString inc_string;
|
|
||||||
PIVector<PIString> incf = inc_files.toVector();
|
PIVector<PIString> incf = inc_files.toVector();
|
||||||
|
for (auto & f: files) incf << f;
|
||||||
|
PIString inc_string;
|
||||||
piForeachC (PIString & i, incf) {
|
piForeachC (PIString & i, incf) {
|
||||||
if ((i != parser.mainFile()) && (streams || texts || getters))
|
if ((i != parser.mainFile()) && (streams || texts || getters))
|
||||||
inc_string << "\n#include \"" << i << "\"";
|
inc_string << "\n#include \"" << i << "\"";
|
||||||
}
|
}
|
||||||
|
//piCout << parser.mainFile() << streams << texts << getters;
|
||||||
|
//piCout << incf;
|
||||||
|
//piCout << inc_string;
|
||||||
|
|
||||||
PIFile f(out + ".cpp");
|
PIFile f(out + ".cpp");
|
||||||
f.clear();
|
f.clear();
|
||||||
@@ -562,11 +566,12 @@ int main(int argc, char * argv[]) {
|
|||||||
piCout << Cyan << Bold << "Parsing done";
|
piCout << Cyan << Bold << "Parsing done";
|
||||||
piCout << Cyan << Bold << "Writing code model ...";
|
piCout << Cyan << Bold << "Writing code model ...";
|
||||||
bool all = cli.hasArgument("All");
|
bool all = cli.hasArgument("All");
|
||||||
writeModel(parser, cli, cli.argumentValue("output"), cli.hasArgument("Metainfo") || all,
|
writeModel(parser, cli, cli.argumentValue("output"), files,
|
||||||
cli.hasArgument("Enum") || all,
|
cli.hasArgument("Metainfo") || all,
|
||||||
cli.hasArgument("Stream") || all,
|
cli.hasArgument("Enum") || all,
|
||||||
cli.hasArgument("Text") || all,
|
cli.hasArgument("Stream") || all,
|
||||||
cli.hasArgument("Getter") || all);
|
cli.hasArgument("Text") || all,
|
||||||
|
cli.hasArgument("Getter") || all);
|
||||||
piCout << Cyan << Bold << "Writing done";
|
piCout << Cyan << Bold << "Writing done";
|
||||||
if (cli.hasArgument("print") || cli.hasArgument("Print")) {
|
if (cli.hasArgument("print") || cli.hasArgument("Print")) {
|
||||||
bool womain = cli.hasArgument("print");
|
bool womain = cli.hasArgument("print");
|
||||||
|
|||||||
Reference in New Issue
Block a user