mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:59:17 +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;
|
procedure TCodeToolsOptions.InitWithEnvironmentVariables;
|
||||||
begin
|
begin
|
||||||
if FPCPath='' then
|
|
||||||
FPCPath:=FindDefaultCompilerFilename;
|
|
||||||
if GetEnvironmentVariableUTF8('PP')<>'' then
|
if GetEnvironmentVariableUTF8('PP')<>'' then
|
||||||
FPCPath:=GetEnvironmentVariableUTF8('PP');
|
FPCPath:=GetEnvironmentVariableUTF8('PP')
|
||||||
|
else if (FPCPath='') or not FileExistsCached(FPCPath) then
|
||||||
|
FPCPath:=FindDefaultCompilerFilename;
|
||||||
if GetEnvironmentVariableUTF8('FPCDIR')<>'' then
|
if GetEnvironmentVariableUTF8('FPCDIR')<>'' then
|
||||||
FPCSrcDir:=GetEnvironmentVariableUTF8('FPCDIR');
|
FPCSrcDir:=GetEnvironmentVariableUTF8('FPCDIR');
|
||||||
if GetEnvironmentVariableUTF8('LAZARUSDIR')<>'' then
|
if GetEnvironmentVariableUTF8('LAZARUSDIR')<>'' then
|
||||||
|
@ -1242,7 +1242,7 @@ function ParseFPCVerbose(List: TStrings; out ConfigFiles: TSTrings;
|
|||||||
i, len, CurPos: integer;
|
i, len, CurPos: integer;
|
||||||
Filename: String;
|
Filename: String;
|
||||||
begin
|
begin
|
||||||
DebugLn(['ProcessOutputLine ',Line]);
|
//DebugLn(['ProcessOutputLine ',Line]);
|
||||||
len := length(Line);
|
len := length(Line);
|
||||||
if len <= 6 then Exit; // shortest match
|
if len <= 6 then Exit; // shortest match
|
||||||
|
|
||||||
@ -8175,7 +8175,7 @@ var
|
|||||||
begin
|
begin
|
||||||
ParseUnitSetID(UnitSetID,CompilerFilename, TargetOS, TargetCPU,
|
ParseUnitSetID(UnitSetID,CompilerFilename, TargetOS, TargetCPU,
|
||||||
Options, FPCSrcDir, ChangeStamp);
|
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,
|
Result:=FindUnitToSrcCache(CompilerFilename, TargetOS, TargetCPU,
|
||||||
Options, FPCSrcDir, false);
|
Options, FPCSrcDir, false);
|
||||||
if Result<>nil then begin
|
if Result<>nil then begin
|
||||||
@ -8427,7 +8427,6 @@ begin
|
|||||||
if (fuscfUnitTreeNeedsUpdate in fFlags)
|
if (fuscfUnitTreeNeedsUpdate in fFlags)
|
||||||
or (fUnitStampOfFiles<>Src.ChangeStamp)
|
or (fUnitStampOfFiles<>Src.ChangeStamp)
|
||||||
or (fUnitStampOfRules<>SrcRules.ChangeStamp) then begin
|
or (fUnitStampOfRules<>SrcRules.ChangeStamp) then begin
|
||||||
debugln(['TFPCUnitSetCache.GetUnitToSourceTree START ChangeStamp=',ChangeStamp]);
|
|
||||||
Exclude(fFlags,fuscfUnitTreeNeedsUpdate);
|
Exclude(fFlags,fuscfUnitTreeNeedsUpdate);
|
||||||
NewSrcDuplicates:=nil;
|
NewSrcDuplicates:=nil;
|
||||||
NewUnitToSourceTree:=nil;
|
NewUnitToSourceTree:=nil;
|
||||||
@ -8451,7 +8450,6 @@ begin
|
|||||||
NewUnitToSourceTree.Free;
|
NewUnitToSourceTree.Free;
|
||||||
NewSrcDuplicates.Free;
|
NewSrcDuplicates.Free;
|
||||||
end;
|
end;
|
||||||
debugln(['TFPCUnitSetCache.GetUnitToSourceTree END ChangeStamp=',ChangeStamp]);
|
|
||||||
end;
|
end;
|
||||||
Result:=fUnitToSourceTree;
|
Result:=fUnitToSourceTree;
|
||||||
end;
|
end;
|
||||||
|
@ -58,24 +58,12 @@ begin
|
|||||||
if FileExists(ConfigFilename) then begin
|
if FileExists(ConfigFilename) then begin
|
||||||
// To not parse the FPC sources every time, the options are saved to a file.
|
// To not parse the FPC sources every time, the options are saved to a file.
|
||||||
Options.LoadFromFile(ConfigFilename);
|
Options.LoadFromFile(ConfigFilename);
|
||||||
end else begin
|
end;
|
||||||
Options.InitWithEnvironmentVariables;
|
Options.InitWithEnvironmentVariables;
|
||||||
if Options.FPCPath='' then
|
|
||||||
Options.FPCPath:='/usr/bin/ppc386';
|
|
||||||
if Options.FPCSrcDir='' then
|
if Options.FPCSrcDir='' then
|
||||||
Options.FPCSrcDir:=ExpandFileName('~/freepascal/fpc');
|
Options.FPCSrcDir:=ExpandFileName('~/freepascal/fpc');
|
||||||
if Options.LazarusSrcDir='' then
|
if Options.LazarusSrcDir='' then
|
||||||
Options.LazarusSrcDir:=ExpandFileName('~/pascal/lazarus');
|
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;
|
|
||||||
|
|
||||||
// optional: ProjectDir and TestPascalFile exists only to easily test some
|
// optional: ProjectDir and TestPascalFile exists only to easily test some
|
||||||
// things.
|
// things.
|
||||||
|
Loading…
Reference in New Issue
Block a user