mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-05 09:56:23 +02:00
IDE: added flag to avoid multithreading - useful for debugging
git-svn-id: trunk@35372 -
This commit is contained in:
parent
badc3e74ca
commit
a4211c814f
@ -74,6 +74,25 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
procedure ApplyFPCSrcFiles(FPCSrcDir: string; var Files: TStringList);
|
||||
var
|
||||
SrcCache: TFPCSourceCache;
|
||||
begin
|
||||
debugln(['ApplyFPCSrcFiles ',FPCSrcDir,' FileCount=',Files.Count]);
|
||||
// copy Files to codetools cache
|
||||
if CodeToolBoss<>nil then
|
||||
begin
|
||||
SrcCache:=CodeToolBoss.FPCDefinesCache.SourceCaches.Find(FPCSrcDir,true);
|
||||
debugln(['ApplyFPCSrcFiles SrcCache.Update ...']);
|
||||
SrcCache.Update(Files);
|
||||
|
||||
debugln(['ApplyFPCSrcFiles BuildBoss.RescanCompilerDefines ...']);
|
||||
if BuildBoss<>nil then
|
||||
BuildBoss.RescanCompilerDefines(false,false,false,true);
|
||||
end;
|
||||
FreeAndNil(Files);
|
||||
end;
|
||||
|
||||
{ TFPCSrcScan }
|
||||
|
||||
procedure TFPCSrcScan.Execute;
|
||||
@ -95,23 +114,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFPCSrcScan.OnFilesGathered;
|
||||
var
|
||||
SrcCache: TFPCSourceCache;
|
||||
begin
|
||||
try
|
||||
debugln(['TFPCSrcScan.OnFilesGathered ',Directory,' FileCount=',Files.Count]);
|
||||
// copy Files to codetools cache
|
||||
if CodeToolBoss<>nil then
|
||||
begin
|
||||
SrcCache:=CodeToolBoss.FPCDefinesCache.SourceCaches.Find(Directory,true);
|
||||
debugln(['TFPCSrcScan.OnFilesGathered SrcCache.Update ...']);
|
||||
SrcCache.Update(Files);
|
||||
|
||||
debugln(['TFPCSrcScan.OnFilesGathered BuildBoss.RescanCompilerDefines ...']);
|
||||
if BuildBoss<>nil then
|
||||
BuildBoss.RescanCompilerDefines(false,false,false,true);
|
||||
end;
|
||||
FreeAndNil(Files);
|
||||
ApplyFPCSrcFiles(Directory,Files);
|
||||
// delete item in progress window
|
||||
debugln(['TFPCSrcScan.OnFilesGathered closing progress item ...']);
|
||||
FreeAndNil(ProgressItem);
|
||||
@ -206,9 +211,20 @@ end;
|
||||
|
||||
procedure TFPCSrcScans.Scan(Directory: string);
|
||||
var
|
||||
{$IFDEF DisableMultiThreading}
|
||||
Files: TStringList;
|
||||
{$ELSE}
|
||||
i: Integer;
|
||||
Item: TFPCSrcScan;
|
||||
{$ENDIF}
|
||||
begin
|
||||
{$IFDEF DisableMultiThreading}
|
||||
// scan fpc source directory, check for terminated
|
||||
Files:=GatherFilesInFPCSources(Directory,nil);
|
||||
if Files=nil then
|
||||
Files:=TStringList.Create;
|
||||
ApplyFPCSrcFiles(Directory,Files);
|
||||
{$ELSE}
|
||||
EnterCriticalsection;
|
||||
try
|
||||
// check if already scanning that directory
|
||||
@ -231,6 +247,7 @@ begin
|
||||
{$ELSE}
|
||||
Item.Start;
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -38,7 +38,7 @@ program Lazarus;
|
||||
{off $DEFINE IDE_MEM_CHECK}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}
|
||||
{$IF defined(UNIX) and not defined(DisableMultiThreading)}
|
||||
cthreads,
|
||||
{$ENDIF}
|
||||
{$IFDEF IDE_MEM_CHECK}
|
||||
|
Loading…
Reference in New Issue
Block a user