浏览代码

Only show memos for includes done by the main script (or its includes). Before it would also show a memo for includes done by other preprocessed files, like .isl files.

Martijn Laan 5 年之前
父节点
当前提交
3000a8ca4d
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Projects/Compile.pas

+ 4 - 1
Projects/Compile.pas

@@ -1816,6 +1816,7 @@ type
   PPreCompilerData = ^TPreCompilerData;
   TPreCompilerData = record
     Compiler: TSetupCompiler;
+    MainScript: Boolean;
     InFiles: TStringList;
     OutLines: TScriptFileLines;
     AnsiConvertCodePage: Cardinal;
@@ -1860,7 +1861,8 @@ begin
   try
     if FromPreProcessor then begin
       Data.Compiler.AddStatus(Format(SCompilerStatusReadingInFile, [Filename]));
-      Data.Compiler.PreprocIncludedFilenames.Add(Filename);
+      if Data.MainScript then
+        Data.Compiler.PreprocIncludedFilenames.Add(Filename);
     end;
     F := TTextFileReader.Create(Filename, fdOpenExisting, faRead, fsRead);
     try
@@ -2057,6 +2059,7 @@ function TSetupCompiler.ReadScriptFile(const Filename: String;
     Data.InFiles := TStringList.Create;
     try
       if Filename = '' then begin
+        Data.MainScript := True;
         Data.InFiles.AddObject('', ReadMainScriptLines);
         FileLoaded := True;
       end