only deal one file onces
This commit is contained in:
parent
d0be43ef70
commit
ce7f5bf520
@ -59,18 +59,13 @@ namespace refl
|
||||
}
|
||||
return parse;
|
||||
}
|
||||
public static List<string> PrepareFileList(List<string> file_list)
|
||||
public static string PreprocessFile(string file_path)
|
||||
{
|
||||
StringBuilder code = new StringBuilder();
|
||||
foreach (var file in file_list)
|
||||
{
|
||||
string fileContent = File.ReadAllText(file);
|
||||
string fileContent = File.ReadAllText(file_path);
|
||||
code.AppendLine(fileContent.Replace("#include", "//#include"));
|
||||
}
|
||||
file_list.Clear();
|
||||
file_list.Add(InputFile);
|
||||
File.WriteAllText(InputFile, code.ToString());
|
||||
return file_list;
|
||||
return InputFile;
|
||||
}
|
||||
public static int CMD_CheckBuildOption(CmdBuildOption opt)
|
||||
{
|
||||
@ -89,7 +84,12 @@ namespace refl
|
||||
{
|
||||
file_list = opt.InputFiles.Skip(1).ToList();
|
||||
}
|
||||
var compilation = CppAst.CppParser.ParseFiles(PrepareFileList(file_list), parse_opt);
|
||||
int index = file_list.Count - 1;
|
||||
if(index >= 0)
|
||||
{
|
||||
file_list[index] = PreprocessFile(file_list[index]);
|
||||
}
|
||||
var compilation = CppAst.CppParser.ParseFiles(file_list, parse_opt);
|
||||
if (opt.Verbose)
|
||||
{
|
||||
// Print diagnostic messages
|
||||
|
||||
Loading…
Reference in New Issue
Block a user