mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:19:19 +02:00
codetools: TCodeToolsOptions.InitWithEnvironmentVariables: search for default
git-svn-id: trunk@26736 -
This commit is contained in:
parent
7dc32fc395
commit
eeb043e59e
@ -297,10 +297,10 @@ end;
|
||||
|
||||
procedure TCodeToolsOptions.InitWithEnvironmentVariables;
|
||||
begin
|
||||
if FPCPath='' then
|
||||
FPCPath:=FindDefaultCompilerFilename;
|
||||
if GetEnvironmentVariableUTF8('PP')<>'' then
|
||||
FPCPath:=GetEnvironmentVariableUTF8('PP');
|
||||
FPCPath:=GetEnvironmentVariableUTF8('PP')
|
||||
else if (FPCPath='') or not FileExistsCached(FPCPath) then
|
||||
FPCPath:=FindDefaultCompilerFilename;
|
||||
if GetEnvironmentVariableUTF8('FPCDIR')<>'' then
|
||||
FPCSrcDir:=GetEnvironmentVariableUTF8('FPCDIR');
|
||||
if GetEnvironmentVariableUTF8('LAZARUSDIR')<>'' then
|
||||
|
@ -1242,7 +1242,7 @@ function ParseFPCVerbose(List: TStrings; out ConfigFiles: TSTrings;
|
||||
i, len, CurPos: integer;
|
||||
Filename: String;
|
||||
begin
|
||||
DebugLn(['ProcessOutputLine ',Line]);
|
||||
//DebugLn(['ProcessOutputLine ',Line]);
|
||||
len := length(Line);
|
||||
if len <= 6 then Exit; // shortest match
|
||||
|
||||
@ -8175,7 +8175,7 @@ var
|
||||
begin
|
||||
ParseUnitSetID(UnitSetID,CompilerFilename, TargetOS, TargetCPU,
|
||||
Options, FPCSrcDir, ChangeStamp);
|
||||
debugln(['TFPCDefinesCache.FindUnitToSrcCache UnitSetID="',dbgstr(UnitSetID),'" CompilerFilename="',CompilerFilename,'" TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',Options,'" FPCSrcDir="',FPCSrcDir,'" ChangeStamp=',ChangeStamp,' exists=',FindUnitToSrcCache(CompilerFilename, TargetOS, TargetCPU,Options, FPCSrcDir,false)<>nil]);
|
||||
//debugln(['TFPCDefinesCache.FindUnitToSrcCache UnitSetID="',dbgstr(UnitSetID),'" CompilerFilename="',CompilerFilename,'" TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',Options,'" FPCSrcDir="',FPCSrcDir,'" ChangeStamp=',ChangeStamp,' exists=',FindUnitToSrcCache(CompilerFilename, TargetOS, TargetCPU,Options, FPCSrcDir,false)<>nil]);
|
||||
Result:=FindUnitToSrcCache(CompilerFilename, TargetOS, TargetCPU,
|
||||
Options, FPCSrcDir, false);
|
||||
if Result<>nil then begin
|
||||
@ -8427,7 +8427,6 @@ begin
|
||||
if (fuscfUnitTreeNeedsUpdate in fFlags)
|
||||
or (fUnitStampOfFiles<>Src.ChangeStamp)
|
||||
or (fUnitStampOfRules<>SrcRules.ChangeStamp) then begin
|
||||
debugln(['TFPCUnitSetCache.GetUnitToSourceTree START ChangeStamp=',ChangeStamp]);
|
||||
Exclude(fFlags,fuscfUnitTreeNeedsUpdate);
|
||||
NewSrcDuplicates:=nil;
|
||||
NewUnitToSourceTree:=nil;
|
||||
@ -8451,7 +8450,6 @@ begin
|
||||
NewUnitToSourceTree.Free;
|
||||
NewSrcDuplicates.Free;
|
||||
end;
|
||||
debugln(['TFPCUnitSetCache.GetUnitToSourceTree END ChangeStamp=',ChangeStamp]);
|
||||
end;
|
||||
Result:=fUnitToSourceTree;
|
||||
end;
|
||||
|
@ -58,24 +58,12 @@ begin
|
||||
if FileExists(ConfigFilename) then begin
|
||||
// To not parse the FPC sources every time, the options are saved to a file.
|
||||
Options.LoadFromFile(ConfigFilename);
|
||||
end else begin
|
||||
Options.InitWithEnvironmentVariables;
|
||||
if Options.FPCPath='' then
|
||||
Options.FPCPath:='/usr/bin/ppc386';
|
||||
if Options.FPCSrcDir='' then
|
||||
Options.FPCSrcDir:=ExpandFileName('~/freepascal/fpc');
|
||||
if Options.LazarusSrcDir='' then
|
||||
Options.LazarusSrcDir:=ExpandFileName('~/pascal/lazarus');
|
||||
{ Linux }
|
||||
{Options.FPCPath:='/usr/bin/ppc386';
|
||||
Options.FPCSrcDir:=ExpandFileName('~/freepascal/fpc');
|
||||
Options.LazarusSrcDir:=ExpandFileName('~/pascal/lazarus');}
|
||||
|
||||
{ Windows
|
||||
Options.FPCPath:='C:\lazarus\fpc\2.0.4\bin\i386-win32\ppc386.exe';
|
||||
Options.FPCSrcDir:='C:\lazarus\fpc\2.0.4\source';
|
||||
Options.LazarusSrcDir:='C:\lazarus\';}
|
||||
end;
|
||||
Options.InitWithEnvironmentVariables;
|
||||
if Options.FPCSrcDir='' then
|
||||
Options.FPCSrcDir:=ExpandFileName('~/freepascal/fpc');
|
||||
if Options.LazarusSrcDir='' then
|
||||
Options.LazarusSrcDir:=ExpandFileName('~/pascal/lazarus');
|
||||
|
||||
// optional: ProjectDir and TestPascalFile exists only to easily test some
|
||||
// things.
|
||||
|
Loading…
Reference in New Issue
Block a user