mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 09:07:31 +01:00
IDE: started array of parsed env paths
git-svn-id: trunk@36051 -
This commit is contained in:
parent
17e13a48b2
commit
dfc84d8ae3
@ -527,7 +527,7 @@ end;
|
||||
|
||||
function TBuildManager.GetTestBuildDirectory: string;
|
||||
begin
|
||||
Result:=EnvironmentOptions.GetTestBuildDirectory;
|
||||
Result:=EnvironmentOptions.GetParsedTestBuildDirectory;
|
||||
end;
|
||||
|
||||
function TBuildManager.IsTestUnitFilename(const AFilename: string): boolean;
|
||||
@ -649,7 +649,7 @@ begin
|
||||
TargetOS:=GetTargetOS;
|
||||
TargetCPU:=GetTargetCPU;
|
||||
CompilerFilename:=EnvironmentOptions.GetCompilerFilename;
|
||||
FPCSrcDir:=EnvironmentOptions.GetFPCSourceDirectory; // needs FPCVer macro
|
||||
FPCSrcDir:=EnvironmentOptions.GetParsedFPCSourceDirectory; // needs FPCVer macro
|
||||
|
||||
{$IFDEF VerboseFPCSrcScan}
|
||||
debugln(['TMainIDE.RescanCompilerDefines A ',
|
||||
|
||||
@ -239,7 +239,7 @@ type
|
||||
procedure SetOutputDirectoryOverride(const AValue: string);
|
||||
public
|
||||
// parsed
|
||||
Values: array[TParsedCompilerOptString] of TParsedString;
|
||||
Values: array[TParsedCompilerOptString] of TParseString;
|
||||
ParsedErrorOption: TParsedCompilerOptString;
|
||||
ParsedErrorMsg: string;
|
||||
ParsedErrorStamp: integer; // see CompilerParseStamp
|
||||
|
||||
@ -171,23 +171,18 @@ var
|
||||
ExternalToolListClass: TExternalToolListClass; // set by ExtToolDialog
|
||||
|
||||
type
|
||||
TParsedEnvOptType = (
|
||||
peoLazarusDirectory,
|
||||
peoCompilerFilename,
|
||||
peopFPCSourceDirectory,
|
||||
peoTestBuildDirectory,
|
||||
peoDebuggerFilename,
|
||||
peoMakeFilename,
|
||||
peoDebuggerSearchPath,
|
||||
peoFPDocPaths,
|
||||
peoCompilerMessagesFilename
|
||||
TEnvOptParseType = (
|
||||
eopLazarusDirectory,
|
||||
eopCompilerFilename,
|
||||
eopFPCSourceDirectory,
|
||||
eopTestBuildDirectory,
|
||||
eopDebuggerFilename,
|
||||
eopMakeFilename,
|
||||
eopDebuggerSearchPath,
|
||||
eopFPDocPaths,
|
||||
eopCompilerMessagesFilename
|
||||
);
|
||||
TParsedEnvOptTypes = set of TParsedEnvOptType;
|
||||
TParsedEnvOption = record
|
||||
Value: string;
|
||||
ParseStamp: integer;
|
||||
Parsing: boolean;
|
||||
end;
|
||||
TEnvOptParseTypes = set of TEnvOptParseType;
|
||||
|
||||
type
|
||||
|
||||
@ -366,10 +361,10 @@ type
|
||||
procedure Save(OnlyDesktop:boolean);
|
||||
property Filename: string read FFilename write SetFilename;
|
||||
procedure CreateConfig;
|
||||
function GetLazarusDirectory: string;
|
||||
function GetTestBuildDirectory: string;
|
||||
function GetParsedLazarusDirectory: string;
|
||||
function GetParsedTestBuildDirectory: string;
|
||||
function GetCompilerFilename: string;
|
||||
function GetFPCSourceDirectory: string;
|
||||
function GetParsedFPCSourceDirectory: string;
|
||||
|
||||
// macro functions
|
||||
procedure InitMacros(AMacroList: TTransferMacroList);
|
||||
@ -621,7 +616,21 @@ const
|
||||
MaxComboBoxCount: integer = 20;
|
||||
EnvOptsConfFileName = 'environmentoptions.xml';
|
||||
BakMaxCounterInfiniteTxt = 'infinite';
|
||||
|
||||
|
||||
EnvOptParseTypeNames: array[TEnvOptParseType] of string = (
|
||||
'LazarusDir', // eopLazarusDirectory
|
||||
'CompPath', // eopCompilerFilename
|
||||
'FPCSrcDir', // eopFPCSourceDirectory
|
||||
'TempDir', // eopTestBuildDirectory
|
||||
'Debugger', // eopDebuggerFilename
|
||||
'DebugPath', // eopDebuggerSearchPath
|
||||
'Make', // eopMakeFilename
|
||||
'FPDocPath', // eopFPDocPaths
|
||||
'CompMsgFile' // eopCompilerMessagesFilename
|
||||
);
|
||||
|
||||
function dbgs(o: TEnvOptParseType): string; overload;
|
||||
|
||||
implementation
|
||||
|
||||
function PascalExtToType(const Ext: string): TPascalExtType;
|
||||
@ -723,6 +732,11 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function dbgs(o: TEnvOptParseType): string;
|
||||
begin
|
||||
Result:=EnvOptParseTypeNames[o];
|
||||
end;
|
||||
|
||||
{ TEnvironmentOptions }
|
||||
|
||||
constructor TEnvironmentOptions.Create;
|
||||
@ -920,7 +934,7 @@ begin
|
||||
Filename:=ConfFilename;
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetLazarusDirectory: string;
|
||||
function TEnvironmentOptions.GetParsedLazarusDirectory: string;
|
||||
begin
|
||||
Result:=LazarusDirectory;
|
||||
end;
|
||||
@ -1662,12 +1676,12 @@ begin
|
||||
InitLayoutHelper(DefaultObjectInspectorName);
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetTestBuildDirectory: string;
|
||||
function TEnvironmentOptions.GetParsedTestBuildDirectory: string;
|
||||
begin
|
||||
Result:=AppendPathDelim(TestBuildDirectory);
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetFPCSourceDirectory: string;
|
||||
function TEnvironmentOptions.GetParsedFPCSourceDirectory: string;
|
||||
begin
|
||||
if (FFPCSrcDirParsedStamp=CTInvalidChangeStamp)
|
||||
or (FFPCSrcDirParsedStamp<>CompilerParseStamp)
|
||||
@ -1722,7 +1736,7 @@ end;
|
||||
function TEnvironmentOptions.MacroFuncFPCSrcDir(const s: string;
|
||||
const Data: PtrInt; var Abort: boolean): string;
|
||||
begin
|
||||
Result:=GetFPCSourceDirectory;
|
||||
Result:=GetParsedFPCSourceDirectory;
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.MacroFuncLazarusDir(const s: string;
|
||||
@ -1752,7 +1766,7 @@ end;
|
||||
function TEnvironmentOptions.MacroFuncTestDir(const s: string;
|
||||
const Data: PtrInt; var Abort: boolean): string;
|
||||
begin
|
||||
Result:=GetTestBuildDirectory;
|
||||
Result:=GetParsedTestBuildDirectory;
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.MacroFuncConfDir(const s: string;
|
||||
|
||||
@ -68,7 +68,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
if AProject.IsVirtual then
|
||||
TargetExeName := EnvironmentOptions.GetTestBuildDirectory +
|
||||
TargetExeName := EnvironmentOptions.GetParsedTestBuildDirectory +
|
||||
ExtractFilename(AProject.MainUnitInfo.Filename)
|
||||
else
|
||||
TargetExeName := AProject.CompilerOptions.CreateTargetFilename(
|
||||
|
||||
@ -106,7 +106,7 @@ begin
|
||||
TargetOS:=BuildBoss.GetTargetOS;
|
||||
TargetCPU:=BuildBoss.GetTargetCPU;
|
||||
CompilerFilename:=EnvironmentOptions.GetCompilerFilename;
|
||||
FPCSrcDir:=EnvironmentOptions.GetFPCSourceDirectory; // needs FPCVer macro
|
||||
FPCSrcDir:=EnvironmentOptions.GetParsedFPCSourceDirectory; // needs FPCVer macro
|
||||
UnitSetCache:=CodeToolBoss.FPCDefinesCache.FindUnitSet(
|
||||
CompilerFilename,TargetOS,TargetCPU,'',FPCSrcDir,true);
|
||||
GatherFPCExecutable(UnitSetCache,sl);
|
||||
|
||||
@ -226,8 +226,8 @@ begin
|
||||
sl.Add('Real CompilerFilename='+EnvironmentOptions.GetCompilerFilename);
|
||||
sl.Add('CompilerMessagesFilename='+EnvironmentOptions.CompilerMessagesFilename);
|
||||
sl.Add('FPC source directory='+EnvironmentOptions.FPCSourceDirectory);
|
||||
sl.Add('Real FPC source directory='+EnvironmentOptions.GetFPCSourceDirectory);
|
||||
sl.Add('Test directory='+EnvironmentOptions.GetTestBuildDirectory);
|
||||
sl.Add('Real FPC source directory='+EnvironmentOptions.GetParsedFPCSourceDirectory);
|
||||
sl.Add('Test directory='+EnvironmentOptions.GetParsedTestBuildDirectory);
|
||||
sl.Add('');
|
||||
end;
|
||||
|
||||
|
||||
@ -225,7 +225,7 @@ procedure StringToStringList(const s: string; List: TStrings);
|
||||
|
||||
// environment
|
||||
type
|
||||
TParsedString = record
|
||||
TParseString = record
|
||||
UnparsedValue: string;
|
||||
ParsedValue: string;
|
||||
ParseStamp: integer;
|
||||
|
||||
@ -12006,7 +12006,7 @@ begin
|
||||
// create target output directory
|
||||
TargetExeName := Project1.CompilerOptions.CreateTargetFilename(Project1.MainFilename);
|
||||
if Project1.IsVirtual and (not FilenameIsAbsolute(TargetExeName)) then
|
||||
TargetExeName := EnvironmentOptions.GetTestBuildDirectory + TargetExeName;
|
||||
TargetExeName := EnvironmentOptions.GetParsedTestBuildDirectory + TargetExeName;
|
||||
TargetExeDirectory:=ExtractFilePath(TargetExeName);
|
||||
if (FilenameIsAbsolute(TargetExeDirectory))
|
||||
and (not DirPathExistsCached(TargetExeDirectory)) then begin
|
||||
@ -14808,7 +14808,7 @@ begin
|
||||
begin
|
||||
CfgCache:=CodeToolBoss.FPCDefinesCache.ConfigCaches.Find(
|
||||
EnvironmentOptions.GetCompilerFilename,'','','',true);
|
||||
if CheckFPCSrcDirQuality(EnvironmentOptions.GetFPCSourceDirectory,Note,
|
||||
if CheckFPCSrcDirQuality(EnvironmentOptions.GetParsedFPCSourceDirectory,Note,
|
||||
CfgCache.GetFPCVer)=sddqInvalid
|
||||
then
|
||||
ShowSetupDialog:=true;
|
||||
@ -14823,7 +14823,7 @@ begin
|
||||
Variables[ExternalMacroStart+'LazarusDir']:=EnvironmentOptions.LazarusDirectory;
|
||||
Variables[ExternalMacroStart+'ProjPath']:=VirtualDirectory;
|
||||
Variables[ExternalMacroStart+'LCLWidgetType']:=LCLPlatformDirNames[GetDefaultLCLWidgetType];
|
||||
Variables[ExternalMacroStart+'FPCSrcDir']:=EnvironmentOptions.GetFPCSourceDirectory;
|
||||
Variables[ExternalMacroStart+'FPCSrcDir']:=EnvironmentOptions.GetParsedFPCSourceDirectory;
|
||||
end;
|
||||
|
||||
// the first template is the "use default" flag
|
||||
|
||||
@ -3699,7 +3699,7 @@ begin
|
||||
EnvironmentOptions.GetCompilerFilename);
|
||||
FPCMakeTool.CmdLineParams:='-q -TAll';
|
||||
FPCMakeTool.EnvironmentOverrides.Add(
|
||||
'FPCDIR='+EnvironmentOptions.GetFPCSourceDirectory);
|
||||
'FPCDIR='+EnvironmentOptions.GetParsedFPCSourceDirectory);
|
||||
|
||||
// clear old errors
|
||||
if SourceEditorManagerIntf<>nil then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user