mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 09:59:23 +02:00
git-svn-id: trunk@28897 -
This commit is contained in:
parent
b86722ce2e
commit
1b48dc89de
@ -1874,7 +1874,6 @@ var
|
|||||||
NewLCLWidgetSet: String;
|
NewLCLWidgetSet: String;
|
||||||
begin
|
begin
|
||||||
with MiscellaneousOptions do begin
|
with MiscellaneousOptions do begin
|
||||||
BuildLazProfiles.UpdateGlobals;
|
|
||||||
NewTargetOS:=BuildLazOpts.TargetOS;
|
NewTargetOS:=BuildLazOpts.TargetOS;
|
||||||
NewTargetCPU:=BuildLazOpts.TargetCPU;
|
NewTargetCPU:=BuildLazOpts.TargetCPU;
|
||||||
NewLCLWidgetSet:=LCLPlatformDirNames[BuildLazOpts.TargetPlatform];
|
NewLCLWidgetSet:=LCLPlatformDirNames[BuildLazOpts.TargetPlatform];
|
||||||
@ -1895,7 +1894,6 @@ var
|
|||||||
BuildIDE: Boolean;
|
BuildIDE: Boolean;
|
||||||
begin
|
begin
|
||||||
with MiscellaneousOptions do begin
|
with MiscellaneousOptions do begin
|
||||||
BuildLazProfiles.UpdateGlobals;
|
|
||||||
NewTargetOS:=LowerCase(BuildLazOpts.TargetOS);
|
NewTargetOS:=LowerCase(BuildLazOpts.TargetOS);
|
||||||
NewTargetCPU:=LowerCase(BuildLazOpts.TargetCPU);
|
NewTargetCPU:=LowerCase(BuildLazOpts.TargetCPU);
|
||||||
NewLCLWidgetSet:=BuildLazOpts.TargetPlatform;
|
NewLCLWidgetSet:=BuildLazOpts.TargetPlatform;
|
||||||
|
@ -159,7 +159,6 @@ type
|
|||||||
|
|
||||||
TBuildLazarusProfiles = class(TObjectList)
|
TBuildLazarusProfiles = class(TObjectList)
|
||||||
private
|
private
|
||||||
fGlobals: TGlobalCompilerOptions;
|
|
||||||
fMakeModeDefs: TMakeModeDefs;
|
fMakeModeDefs: TMakeModeDefs;
|
||||||
fRestartAfterBuild: boolean;
|
fRestartAfterBuild: boolean;
|
||||||
fConfirmBuild: boolean;
|
fConfirmBuild: boolean;
|
||||||
@ -180,9 +179,7 @@ type
|
|||||||
procedure Load(XMLConfig: TXMLConfig; const Path: string; const FileVersion: integer);
|
procedure Load(XMLConfig: TXMLConfig; const Path: string; const FileVersion: integer);
|
||||||
procedure Save(XMLConfig: TXMLConfig; const Path: string);
|
procedure Save(XMLConfig: TXMLConfig; const Path: string);
|
||||||
procedure Move(CurIndex, NewIndex: Integer); // Replaces TList.Move
|
procedure Move(CurIndex, NewIndex: Integer); // Replaces TList.Move
|
||||||
procedure UpdateGlobals;
|
|
||||||
public
|
public
|
||||||
property Globals: TGlobalCompilerOptions read fGlobals;
|
|
||||||
property MakeModeDefs: TMakeModeDefs read fMakeModeDefs;
|
property MakeModeDefs: TMakeModeDefs read fMakeModeDefs;
|
||||||
property RestartAfterBuild: boolean read fRestartAfterBuild write fRestartAfterBuild;
|
property RestartAfterBuild: boolean read fRestartAfterBuild write fRestartAfterBuild;
|
||||||
property ConfirmBuild: boolean read fConfirmBuild write fConfirmBuild;
|
property ConfirmBuild: boolean read fConfirmBuild write fConfirmBuild;
|
||||||
@ -551,7 +548,6 @@ end;
|
|||||||
constructor TBuildLazarusProfiles.Create;
|
constructor TBuildLazarusProfiles.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
fGlobals:=TGlobalCompilerOptions.Create;
|
|
||||||
fMakeModeDefs:=TMakeModeDefs.Create;
|
fMakeModeDefs:=TMakeModeDefs.Create;
|
||||||
fRestartAfterBuild:=True;
|
fRestartAfterBuild:=True;
|
||||||
fConfirmBuild:=True;
|
fConfirmBuild:=True;
|
||||||
@ -563,7 +559,6 @@ end;
|
|||||||
destructor TBuildLazarusProfiles.Destroy;
|
destructor TBuildLazarusProfiles.Destroy;
|
||||||
begin
|
begin
|
||||||
fMakeModeDefs.Free;
|
fMakeModeDefs.Free;
|
||||||
fGlobals.Free;
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
// Clear is called by inherited Destroy. Must be freed later.
|
// Clear is called by inherited Destroy. Must be freed later.
|
||||||
fStaticAutoInstallPackages.Free;
|
fStaticAutoInstallPackages.Free;
|
||||||
@ -585,8 +580,6 @@ var
|
|||||||
SrcItem, NewItem: TBuildLazarusProfile;
|
SrcItem, NewItem: TBuildLazarusProfile;
|
||||||
begin
|
begin
|
||||||
Clear;
|
Clear;
|
||||||
fGlobals.TargetCPU:=Source.fGlobals.TargetCPU;
|
|
||||||
fGlobals.TargetOS:=Source.fGlobals.TargetOS;
|
|
||||||
fMakeModeDefs.Assign(Source.MakeModeDefs);
|
fMakeModeDefs.Assign(Source.MakeModeDefs);
|
||||||
RestartAfterBuild :=Source.RestartAfterBuild;
|
RestartAfterBuild :=Source.RestartAfterBuild;
|
||||||
ConfirmBuild:=Source.ConfirmBuild;
|
ConfirmBuild:=Source.ConfirmBuild;
|
||||||
@ -785,12 +778,6 @@ begin
|
|||||||
fCurrentIndex:=NewIndex;
|
fCurrentIndex:=NewIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildLazarusProfiles.UpdateGlobals;
|
|
||||||
begin
|
|
||||||
Globals.TargetOS:=Current.FPCTargetOS;
|
|
||||||
Globals.TargetCPU:=Current.FPCTargetCPU;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TBuildLazarusProfiles.GetCurrentProfile: TBuildLazarusProfile;
|
function TBuildLazarusProfiles.GetCurrentProfile: TBuildLazarusProfile;
|
||||||
begin
|
begin
|
||||||
Result:=Items[fCurrentIndex];
|
Result:=Items[fCurrentIndex];
|
||||||
|
@ -390,7 +390,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
try
|
try
|
||||||
// create compiler command line options
|
// create compiler command line options
|
||||||
CmdLineParams:=Options.MakeOptionsString(BogusFilename,nil,
|
CmdLineParams:=Options.MakeOptionsString(BogusFilename,
|
||||||
[ccloAddVerboseAll,ccloDoNotAppendOutFileOption,ccloAbsolutePaths])
|
[ccloAddVerboseAll,ccloDoNotAppendOutFileOption,ccloAbsolutePaths])
|
||||||
+' '+BogusFilename;
|
+' '+BogusFilename;
|
||||||
|
|
||||||
|
@ -138,20 +138,6 @@ type
|
|||||||
procedure Assign(Source: TLazBuildMacros);
|
procedure Assign(Source: TLazBuildMacros);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TGlobalCompilerOptions - compiler options overrides }
|
|
||||||
|
|
||||||
TGlobalCompilerOptions = class
|
|
||||||
private
|
|
||||||
FTargetCPU: string;
|
|
||||||
FTargetOS: string;
|
|
||||||
procedure SetTargetCPU(const AValue: string);
|
|
||||||
procedure SetTargetOS(const AValue: string);
|
|
||||||
public
|
|
||||||
property TargetCPU: string read FTargetCPU write SetTargetCPU;
|
|
||||||
property TargetOS: string read FTargetOS write SetTargetOS;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TInheritedCompilerOption = (
|
TInheritedCompilerOption = (
|
||||||
icoNone,
|
icoNone,
|
||||||
@ -517,10 +503,8 @@ type
|
|||||||
function CreateDiff(CompOpts: TBaseCompilerOptions;
|
function CreateDiff(CompOpts: TBaseCompilerOptions;
|
||||||
Tool: TCompilerDiffTool = nil): boolean; virtual;// true if differ
|
Tool: TCompilerDiffTool = nil): boolean; virtual;// true if differ
|
||||||
|
|
||||||
function MakeOptionsString(Globals: TGlobalCompilerOptions;
|
function MakeOptionsString(Flags: TCompilerCmdLineOptions): String;
|
||||||
Flags: TCompilerCmdLineOptions): String;
|
|
||||||
function MakeOptionsString(const MainSourceFileName: string;
|
function MakeOptionsString(const MainSourceFileName: string;
|
||||||
Globals: TGlobalCompilerOptions;
|
|
||||||
Flags: TCompilerCmdLineOptions): String; virtual;
|
Flags: TCompilerCmdLineOptions): String; virtual;
|
||||||
function GetSyntaxOptionsString: string; virtual;
|
function GetSyntaxOptionsString: string; virtual;
|
||||||
function CreateTargetFilename(const MainSourceFileName: string): string; virtual;
|
function CreateTargetFilename(const MainSourceFileName: string): string; virtual;
|
||||||
@ -2190,10 +2174,10 @@ end;
|
|||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TBaseCompilerOptions MakeOptionsString
|
TBaseCompilerOptions MakeOptionsString
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TBaseCompilerOptions.MakeOptionsString(Globals: TGlobalCompilerOptions;
|
function TBaseCompilerOptions.MakeOptionsString(
|
||||||
Flags: TCompilerCmdLineOptions): String;
|
Flags: TCompilerCmdLineOptions): String;
|
||||||
begin
|
begin
|
||||||
Result:=MakeOptionsString(GetDefaultMainSourceFileName,Globals,Flags);
|
Result:=MakeOptionsString(GetDefaultMainSourceFileName,Flags);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetIgnoredMsgsIndexes(msglist: TCompilerMessagesList; const Separator: string): string;
|
function GetIgnoredMsgsIndexes(msglist: TCompilerMessagesList; const Separator: string): string;
|
||||||
@ -2214,13 +2198,12 @@ end;
|
|||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
function TBaseCompilerOptions.MakeOptionsString(
|
function TBaseCompilerOptions.MakeOptionsString(
|
||||||
const MainSourceFilename: string;
|
const MainSourceFilename: string;
|
||||||
Globals: TGlobalCompilerOptions;
|
|
||||||
Flags: TCompilerCmdLineOptions): String;
|
Flags: TCompilerCmdLineOptions): String;
|
||||||
|
|
||||||
Get all the options and create a string that can be passed to the compiler
|
Get all the options and create a string that can be passed to the compiler
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TBaseCompilerOptions.MakeOptionsString(
|
function TBaseCompilerOptions.MakeOptionsString(
|
||||||
const MainSourceFilename: string; Globals: TGlobalCompilerOptions;
|
const MainSourceFilename: string;
|
||||||
Flags: TCompilerCmdLineOptions): String;
|
Flags: TCompilerCmdLineOptions): String;
|
||||||
var
|
var
|
||||||
switches, tempsw, t: String;
|
switches, tempsw, t: String;
|
||||||
@ -2237,6 +2220,8 @@ var
|
|||||||
CurCustomOptions: String;
|
CurCustomOptions: String;
|
||||||
OptimizeSwitches: String;
|
OptimizeSwitches: String;
|
||||||
LinkerAddition: String;
|
LinkerAddition: String;
|
||||||
|
Vars: TCTCfgScriptVariables;
|
||||||
|
v: string;
|
||||||
begin
|
begin
|
||||||
CurMainSrcFile:=MainSourceFileName;
|
CurMainSrcFile:=MainSourceFileName;
|
||||||
if CurMainSrcFile='' then
|
if CurMainSrcFile='' then
|
||||||
@ -2537,16 +2522,19 @@ begin
|
|||||||
OS2 = OS/2 (2.x) using the EMX extender.
|
OS2 = OS/2 (2.x) using the EMX extender.
|
||||||
WIN32 = Windows 32 bit.
|
WIN32 = Windows 32 bit.
|
||||||
... }
|
... }
|
||||||
{ Target OS }
|
debugln(['TBaseCompilerOptions.MakeOptionsString ']);
|
||||||
if (Globals<>nil) and (Globals.TargetOS<>'') then
|
Vars:=GetBuildMacroValues(Self,true);
|
||||||
switches := switches + ' -T' + Globals.TargetOS
|
if Vars<>nil then
|
||||||
else if (TargetOS<>'') then
|
begin
|
||||||
switches := switches + ' -T' + TargetOS;
|
{ Target OS }
|
||||||
{ Target CPU }
|
v:=GetFPCTargetOS(Vars.Values['TargetOS']);
|
||||||
if (Globals<>nil) and (Globals.TargetCPU<>'') then
|
if (v<>'') and (v<>GetDefaultTargetOS) then
|
||||||
switches := switches + ' -P' + Globals.TargetCPU
|
switches := switches + ' -T' + v;
|
||||||
else if (TargetCPU<>'') then
|
{ Target CPU }
|
||||||
switches := switches + ' -P' + TargetCPU;
|
v:=GetFPCTargetCPU(Vars.Values['TargetCPU']);
|
||||||
|
if (v<>'') and (v<>GetDefaultTargetCPU) then
|
||||||
|
switches := switches + ' -P' + v;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ --------------- Linking Tab ------------------- }
|
{ --------------- Linking Tab ------------------- }
|
||||||
@ -3818,20 +3806,6 @@ begin
|
|||||||
if assigned(OnChanged) then OnChanged(Self);
|
if assigned(OnChanged) then OnChanged(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TGlobalCompilerOptions }
|
|
||||||
|
|
||||||
procedure TGlobalCompilerOptions.SetTargetCPU(const AValue: string);
|
|
||||||
begin
|
|
||||||
if FTargetCPU=AValue then exit;
|
|
||||||
FTargetCPU:=AValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TGlobalCompilerOptions.SetTargetOS(const AValue: string);
|
|
||||||
begin
|
|
||||||
if FTargetOS=AValue then exit;
|
|
||||||
FTargetOS:=AValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TIDEBuildMacro }
|
{ TIDEBuildMacro }
|
||||||
|
|
||||||
procedure TIDEBuildMacro.SetIdentifier(const AValue: string);
|
procedure TIDEBuildMacro.SetIdentifier(const AValue: string);
|
||||||
|
@ -11054,7 +11054,7 @@ begin
|
|||||||
//DebugLn(['TMainIDE.DoBuildProject CompilerFilename="',CompilerFilename,'" CompilerPath="',Project1.CompilerOptions.CompilerPath,'"']);
|
//DebugLn(['TMainIDE.DoBuildProject CompilerFilename="',CompilerFilename,'" CompilerPath="',Project1.CompilerOptions.CompilerPath,'"']);
|
||||||
// Note: use absolute paths, because some external tools resolve symlinked directories
|
// Note: use absolute paths, because some external tools resolve symlinked directories
|
||||||
CompilerParams :=
|
CompilerParams :=
|
||||||
Project1.CompilerOptions.MakeOptionsString(SrcFilename,nil,[ccloAbsolutePaths])
|
Project1.CompilerOptions.MakeOptionsString(SrcFilename,[ccloAbsolutePaths])
|
||||||
+ ' ' + PrepareCmdLineOption(SrcFilename);
|
+ ' ' + PrepareCmdLineOption(SrcFilename);
|
||||||
//DebugLn('TMainIDE.DoBuildProject WorkingDir="',WorkingDir,'" SrcFilename="',SrcFilename,'" CompilerFilename="',CompilerFilename,'" CompilerParams="',CompilerParams,'"');
|
//DebugLn('TMainIDE.DoBuildProject WorkingDir="',WorkingDir,'" SrcFilename="',SrcFilename,'" CompilerFilename="',CompilerFilename,'" CompilerParams="',CompilerParams,'"');
|
||||||
|
|
||||||
|
@ -496,7 +496,6 @@ type
|
|||||||
|
|
||||||
TProjectCompilerOptions = class(TBaseCompilerOptions)
|
TProjectCompilerOptions = class(TBaseCompilerOptions)
|
||||||
private
|
private
|
||||||
FGlobals: TGlobalCompilerOptions;
|
|
||||||
FProject: TProject;
|
FProject: TProject;
|
||||||
FCompileReasons: TCompileReasons;
|
FCompileReasons: TCompileReasons;
|
||||||
protected
|
protected
|
||||||
@ -511,7 +510,6 @@ type
|
|||||||
procedure SetUnitPaths(const AValue: string); override;
|
procedure SetUnitPaths(const AValue: string); override;
|
||||||
procedure SetUnitOutputDir(const AValue: string); override;
|
procedure SetUnitOutputDir(const AValue: string); override;
|
||||||
procedure SetConditionals(const AValue: string); override;
|
procedure SetConditionals(const AValue: string); override;
|
||||||
procedure UpdateGlobals; virtual;
|
|
||||||
public
|
public
|
||||||
constructor Create(const AOwner: TObject); override;
|
constructor Create(const AOwner: TObject); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -533,7 +531,6 @@ type
|
|||||||
function GetEffectiveLCLWidgetType: string; override;
|
function GetEffectiveLCLWidgetType: string; override;
|
||||||
public
|
public
|
||||||
property LazProject: TProject read FProject;
|
property LazProject: TProject read FProject;
|
||||||
property Globals: TGlobalCompilerOptions read FGlobals;
|
|
||||||
published
|
published
|
||||||
property CompileReasons: TCompileReasons read FCompileReasons write FCompileReasons;
|
property CompileReasons: TCompileReasons read FCompileReasons write FCompileReasons;
|
||||||
end;
|
end;
|
||||||
@ -5754,15 +5751,11 @@ end;
|
|||||||
procedure TProjectCompilerOptions.SetTargetCPU(const AValue: string);
|
procedure TProjectCompilerOptions.SetTargetCPU(const AValue: string);
|
||||||
begin
|
begin
|
||||||
inherited SetTargetCPU(AValue);
|
inherited SetTargetCPU(AValue);
|
||||||
if IsActive then
|
|
||||||
FGlobals.TargetCPU:=GetFPCTargetCPU(TargetCPU);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectCompilerOptions.SetTargetOS(const AValue: string);
|
procedure TProjectCompilerOptions.SetTargetOS(const AValue: string);
|
||||||
begin
|
begin
|
||||||
inherited SetTargetOS(AValue);
|
inherited SetTargetOS(AValue);
|
||||||
if IsActive then
|
|
||||||
FGlobals.TargetOS:=GetFPCTargetOS(TargetOS);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectCompilerOptions.SetCustomOptions(const AValue: string);
|
procedure TProjectCompilerOptions.SetCustomOptions(const AValue: string);
|
||||||
@ -5847,7 +5840,6 @@ begin
|
|||||||
FCompileReasons := [crCompile, crBuild, crRun];
|
FCompileReasons := [crCompile, crBuild, crRun];
|
||||||
// keep BuildModes
|
// keep BuildModes
|
||||||
end;
|
end;
|
||||||
UpdateGlobals;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProjectCompilerOptions.IsEqual(CompOpts: TBaseCompilerOptions
|
function TProjectCompilerOptions.IsEqual(CompOpts: TBaseCompilerOptions
|
||||||
@ -5886,13 +5878,6 @@ begin
|
|||||||
Result:=LCLPlatformDirNames[lpNoGUI];
|
Result:=LCLPlatformDirNames[lpNoGUI];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectCompilerOptions.UpdateGlobals;
|
|
||||||
begin
|
|
||||||
if not IsActive then exit;
|
|
||||||
FGlobals.TargetCPU:=TargetCPU;
|
|
||||||
FGlobals.TargetOS:=TargetOS;
|
|
||||||
end;
|
|
||||||
|
|
||||||
class function TProjectCompilerOptions.GetInstance: TAbstractIDEOptions;
|
class function TProjectCompilerOptions.GetInstance: TAbstractIDEOptions;
|
||||||
begin
|
begin
|
||||||
Result := Project1.CompilerOptions;
|
Result := Project1.CompilerOptions;
|
||||||
@ -5905,7 +5890,6 @@ end;
|
|||||||
|
|
||||||
constructor TProjectCompilerOptions.Create(const AOwner: TObject);
|
constructor TProjectCompilerOptions.Create(const AOwner: TObject);
|
||||||
begin
|
begin
|
||||||
FGlobals := TGlobalCompilerOptions.Create;
|
|
||||||
FCompileReasons := [crCompile, crBuild, crRun];
|
FCompileReasons := [crCompile, crBuild, crRun];
|
||||||
inherited Create(AOwner, TProjectCompilationToolOptions);
|
inherited Create(AOwner, TProjectCompilationToolOptions);
|
||||||
with TProjectCompilationToolOptions(ExecuteBefore) do begin
|
with TProjectCompilationToolOptions(ExecuteBefore) do begin
|
||||||
@ -5916,7 +5900,6 @@ begin
|
|||||||
DefaultCompileReasons:=crAll;
|
DefaultCompileReasons:=crAll;
|
||||||
CompileReasons:=DefaultCompileReasons;
|
CompileReasons:=DefaultCompileReasons;
|
||||||
end;
|
end;
|
||||||
UpdateGlobals;
|
|
||||||
if AOwner <> nil
|
if AOwner <> nil
|
||||||
then FProject := AOwner as TProject;
|
then FProject := AOwner as TProject;
|
||||||
end;
|
end;
|
||||||
@ -5924,7 +5907,6 @@ end;
|
|||||||
destructor TProjectCompilerOptions.Destroy;
|
destructor TProjectCompilerOptions.Destroy;
|
||||||
begin
|
begin
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
FreeAndNil(FGlobals);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProjectCompilerOptions.IsActive: boolean;
|
function TProjectCompilerOptions.IsActive: boolean;
|
||||||
|
@ -107,7 +107,7 @@ begin
|
|||||||
Flags:=CompilerOpts.DefaultMakeOptionsFlags;
|
Flags:=CompilerOpts.DefaultMakeOptionsFlags;
|
||||||
if not RelativePathsCheckBox.Checked then
|
if not RelativePathsCheckBox.Checked then
|
||||||
Include(Flags,ccloAbsolutePaths);
|
Include(Flags,ccloAbsolutePaths);
|
||||||
CurOptions := CompilerOpts.MakeOptionsString(nil,Flags);
|
CurOptions := CompilerOpts.MakeOptionsString(Flags);
|
||||||
CmdLineMemo.Lines.Text:=CurOptions;
|
CmdLineMemo.Lines.Text:=CurOptions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -132,8 +132,7 @@ type
|
|||||||
function DoCompileProjectDependencies(AProject: TProject;
|
function DoCompileProjectDependencies(AProject: TProject;
|
||||||
Flags: TPkgCompileFlags): TModalResult; virtual; abstract;
|
Flags: TPkgCompileFlags): TModalResult; virtual; abstract;
|
||||||
function DoCompilePackage(APackage: TLazPackage; Flags: TPkgCompileFlags;
|
function DoCompilePackage(APackage: TLazPackage; Flags: TPkgCompileFlags;
|
||||||
ShowAbort: boolean;
|
ShowAbort: boolean): TModalResult; virtual; abstract;
|
||||||
Globals: TGlobalCompilerOptions = nil): TModalResult; virtual; abstract;
|
|
||||||
|
|
||||||
// package installation
|
// package installation
|
||||||
procedure LoadInstalledPackages; virtual; abstract;
|
procedure LoadInstalledPackages; virtual; abstract;
|
||||||
|
@ -284,14 +284,11 @@ type
|
|||||||
Flags: TPkgCompileFlags; ShowAbort: boolean): TModalResult;
|
Flags: TPkgCompileFlags; ShowAbort: boolean): TModalResult;
|
||||||
function CompileRequiredPackages(APackage: TLazPackage;
|
function CompileRequiredPackages(APackage: TLazPackage;
|
||||||
FirstDependency: TPkgDependency;
|
FirstDependency: TPkgDependency;
|
||||||
Globals: TGlobalCompilerOptions;
|
|
||||||
Policies: TPackageUpdatePolicies): TModalResult;
|
Policies: TPackageUpdatePolicies): TModalResult;
|
||||||
function CompilePackage(APackage: TLazPackage; Flags: TPkgCompileFlags;
|
function CompilePackage(APackage: TLazPackage; Flags: TPkgCompileFlags;
|
||||||
ShowAbort: boolean;
|
ShowAbort: boolean): TModalResult;
|
||||||
Globals: TGlobalCompilerOptions = nil): TModalResult;
|
|
||||||
function ConvertPackageRSTFiles(APackage: TLazPackage): TModalResult;
|
function ConvertPackageRSTFiles(APackage: TLazPackage): TModalResult;
|
||||||
function WriteMakeFile(APackage: TLazPackage;
|
function WriteMakeFile(APackage: TLazPackage): TModalResult;
|
||||||
Globals: TGlobalCompilerOptions): TModalResult;
|
|
||||||
public
|
public
|
||||||
// installed packages
|
// installed packages
|
||||||
FirstAutoInstallDependency: TPkgDependency;
|
FirstAutoInstallDependency: TPkgDependency;
|
||||||
@ -3154,8 +3151,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.CompileRequiredPackages(APackage: TLazPackage;
|
function TLazPackageGraph.CompileRequiredPackages(APackage: TLazPackage;
|
||||||
FirstDependency: TPkgDependency; Globals: TGlobalCompilerOptions;
|
FirstDependency: TPkgDependency; Policies: TPackageUpdatePolicies): TModalResult;
|
||||||
Policies: TPackageUpdatePolicies): TModalResult;
|
|
||||||
var
|
var
|
||||||
AutoPackages: TFPList;
|
AutoPackages: TFPList;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -3172,7 +3168,7 @@ begin
|
|||||||
while i<AutoPackages.Count do begin
|
while i<AutoPackages.Count do begin
|
||||||
Result:=CompilePackage(TLazPackage(AutoPackages[i]),
|
Result:=CompilePackage(TLazPackage(AutoPackages[i]),
|
||||||
[pcfDoNotCompileDependencies,pcfOnlyIfNeeded,
|
[pcfDoNotCompileDependencies,pcfOnlyIfNeeded,
|
||||||
pcfDoNotSaveEditorFiles],false,Globals);
|
pcfDoNotSaveEditorFiles],false);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
@ -3187,8 +3183,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.CompilePackage(APackage: TLazPackage;
|
function TLazPackageGraph.CompilePackage(APackage: TLazPackage;
|
||||||
Flags: TPkgCompileFlags; ShowAbort: boolean; Globals: TGlobalCompilerOptions
|
Flags: TPkgCompileFlags; ShowAbort: boolean): TModalResult;
|
||||||
): TModalResult;
|
|
||||||
|
|
||||||
function GetIgnoreIdentifier: string;
|
function GetIgnoreIdentifier: string;
|
||||||
begin
|
begin
|
||||||
@ -3222,8 +3217,7 @@ begin
|
|||||||
CompilePolicies:=[pupAsNeeded];
|
CompilePolicies:=[pupAsNeeded];
|
||||||
if pcfCompileDependenciesClean in Flags then
|
if pcfCompileDependenciesClean in Flags then
|
||||||
Include(CompilePolicies,pupOnRebuildingAll);
|
Include(CompilePolicies,pupOnRebuildingAll);
|
||||||
Result:=CompileRequiredPackages(APackage,nil,Globals,
|
Result:=CompileRequiredPackages(APackage,nil,CompilePolicies);
|
||||||
CompilePolicies);
|
|
||||||
if Result<>mrOk then begin
|
if Result<>mrOk then begin
|
||||||
DebugLn(['TLazPackageGraph.CompilePackage CompileRequiredPackages failed: ',APackage.IDAsString]);
|
DebugLn(['TLazPackageGraph.CompilePackage CompileRequiredPackages failed: ',APackage.IDAsString]);
|
||||||
exit;
|
exit;
|
||||||
@ -3233,7 +3227,7 @@ begin
|
|||||||
SrcFilename:=APackage.GetSrcFilename;
|
SrcFilename:=APackage.GetSrcFilename;
|
||||||
CompilerFilename:=APackage.GetCompilerFilename;
|
CompilerFilename:=APackage.GetCompilerFilename;
|
||||||
// Note: use absolute paths, because some external tools resolve symlinked directories
|
// Note: use absolute paths, because some external tools resolve symlinked directories
|
||||||
CompilerParams:=APackage.CompilerOptions.MakeOptionsString(Globals,
|
CompilerParams:=APackage.CompilerOptions.MakeOptionsString(
|
||||||
APackage.CompilerOptions.DefaultMakeOptionsFlags+[ccloAbsolutePaths])
|
APackage.CompilerOptions.DefaultMakeOptionsFlags+[ccloAbsolutePaths])
|
||||||
+' '+CreateRelativePath(SrcFilename,APackage.Directory);
|
+' '+CreateRelativePath(SrcFilename,APackage.Directory);
|
||||||
//DebugLn(['TLazPackageGraph.CompilePackage SrcFilename="',SrcFilename,'" CompilerFilename="',CompilerFilename,'" CompilerParams="',CompilerParams,'" TargetCPU=',Globals.TargetCPU,' TargetOS=',Globals.TargetOS]);
|
//DebugLn(['TLazPackageGraph.CompilePackage SrcFilename="',SrcFilename,'" CompilerFilename="',CompilerFilename,'" CompilerParams="',CompilerParams,'" TargetCPU=',Globals.TargetCPU,' TargetOS=',Globals.TargetOS]);
|
||||||
@ -3286,7 +3280,7 @@ begin
|
|||||||
// create Makefile
|
// create Makefile
|
||||||
if ((pcfCreateMakefile in Flags)
|
if ((pcfCreateMakefile in Flags)
|
||||||
or (APackage.CompilerOptions.CreateMakefileOnBuild)) then begin
|
or (APackage.CompilerOptions.CreateMakefileOnBuild)) then begin
|
||||||
Result:=WriteMakeFile(APackage,Globals);
|
Result:=WriteMakeFile(APackage);
|
||||||
if Result<>mrOk then begin
|
if Result<>mrOk then begin
|
||||||
DebugLn('TLazPackageGraph.CompilePackage DoWriteMakefile failed: ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CompilePackage DoWriteMakefile failed: ',APackage.IDAsString);
|
||||||
exit;
|
exit;
|
||||||
@ -3459,8 +3453,7 @@ begin
|
|||||||
Result:=mrOK;
|
Result:=mrOK;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.WriteMakeFile(APackage: TLazPackage;
|
function TLazPackageGraph.WriteMakeFile(APackage: TLazPackage): TModalResult;
|
||||||
Globals: TGlobalCompilerOptions): TModalResult;
|
|
||||||
var
|
var
|
||||||
PathDelimNeedsReplace: Boolean;
|
PathDelimNeedsReplace: Boolean;
|
||||||
|
|
||||||
@ -3549,7 +3542,7 @@ begin
|
|||||||
coptParsedPlatformIndependent);
|
coptParsedPlatformIndependent);
|
||||||
CustomOptions:=APackage.CompilerOptions.GetCustomOptions(
|
CustomOptions:=APackage.CompilerOptions.GetCustomOptions(
|
||||||
coptParsedPlatformIndependent);
|
coptParsedPlatformIndependent);
|
||||||
OtherOptions:=APackage.CompilerOptions.MakeOptionsString(Globals,
|
OtherOptions:=APackage.CompilerOptions.MakeOptionsString(
|
||||||
[ccloDoNotAppendOutFileOption,ccloNoMacroParams]);
|
[ccloDoNotAppendOutFileOption,ccloNoMacroParams]);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -292,8 +292,7 @@ type
|
|||||||
function DoCompileProjectDependencies(AProject: TProject;
|
function DoCompileProjectDependencies(AProject: TProject;
|
||||||
Flags: TPkgCompileFlags): TModalResult; override;
|
Flags: TPkgCompileFlags): TModalResult; override;
|
||||||
function DoCompilePackage(APackage: TLazPackage; Flags: TPkgCompileFlags;
|
function DoCompilePackage(APackage: TLazPackage; Flags: TPkgCompileFlags;
|
||||||
ShowAbort: boolean;
|
ShowAbort: boolean): TModalResult; override;
|
||||||
Globals: TGlobalCompilerOptions = nil): TModalResult; override;
|
|
||||||
function DoCreatePackageMakefile(APackage: TLazPackage;
|
function DoCreatePackageMakefile(APackage: TLazPackage;
|
||||||
ShowAbort: boolean): TModalResult;
|
ShowAbort: boolean): TModalResult;
|
||||||
|
|
||||||
@ -648,17 +647,12 @@ function TPkgManager.OnPackageEditorCompilePackage(Sender: TObject;
|
|||||||
APackage: TLazPackage; CompileClean, CompileRequired: boolean): TModalResult;
|
APackage: TLazPackage; CompileClean, CompileRequired: boolean): TModalResult;
|
||||||
var
|
var
|
||||||
Flags: TPkgCompileFlags;
|
Flags: TPkgCompileFlags;
|
||||||
Globals: TGlobalCompilerOptions;
|
|
||||||
begin
|
begin
|
||||||
Flags:=[];
|
Flags:=[];
|
||||||
if CompileClean then Include(Flags,pcfCleanCompile);
|
if CompileClean then Include(Flags,pcfCleanCompile);
|
||||||
if CompileRequired then Include(Flags,pcfCompileDependenciesClean);
|
if CompileRequired then Include(Flags,pcfCompileDependenciesClean);
|
||||||
if Project1<>nil then
|
|
||||||
Globals:=Project1.CompilerOptions.Globals
|
|
||||||
else
|
|
||||||
Globals:=nil;
|
|
||||||
//debugln('TPkgManager.OnPackageEditorCompilePackage OS=',Globals.TargetOS);
|
//debugln('TPkgManager.OnPackageEditorCompilePackage OS=',Globals.TargetOS);
|
||||||
Result:=DoCompilePackage(APackage,Flags,false,Globals);
|
Result:=DoCompilePackage(APackage,Flags,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgManager.OnPackageEditorCreateMakefile(Sender: TObject;
|
function TPkgManager.OnPackageEditorCreateMakefile(Sender: TObject;
|
||||||
@ -2563,7 +2557,6 @@ begin
|
|||||||
if not (pcfDoNotCompileDependencies in Flags) then begin
|
if not (pcfDoNotCompileDependencies in Flags) then begin
|
||||||
Result:=PackageGraph.CompileRequiredPackages(nil,
|
Result:=PackageGraph.CompileRequiredPackages(nil,
|
||||||
AProject.FirstRequiredDependency,
|
AProject.FirstRequiredDependency,
|
||||||
AProject.CompilerOptions.Globals,
|
|
||||||
[pupAsNeeded]);
|
[pupAsNeeded]);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
end;
|
end;
|
||||||
@ -2575,8 +2568,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgManager.DoCompilePackage(APackage: TLazPackage;
|
function TPkgManager.DoCompilePackage(APackage: TLazPackage;
|
||||||
Flags: TPkgCompileFlags; ShowAbort: boolean; Globals: TGlobalCompilerOptions
|
Flags: TPkgCompileFlags; ShowAbort: boolean): TModalResult;
|
||||||
): TModalResult;
|
|
||||||
begin
|
begin
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
|
|
||||||
@ -2605,14 +2597,14 @@ begin
|
|||||||
Result:=WarnAboutMissingPackageFiles(APackage);
|
Result:=WarnAboutMissingPackageFiles(APackage);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
|
|
||||||
Result:=PackageGraph.CompilePackage(APackage,Flags,false,Globals);
|
Result:=PackageGraph.CompilePackage(APackage,Flags,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgManager.DoCreatePackageMakefile(APackage: TLazPackage;
|
function TPkgManager.DoCreatePackageMakefile(APackage: TLazPackage;
|
||||||
ShowAbort: boolean): TModalResult;
|
ShowAbort: boolean): TModalResult;
|
||||||
begin
|
begin
|
||||||
Result:=DoCompilePackage(APackage,[pcfDoNotCompileDependencies,
|
Result:=DoCompilePackage(APackage,[pcfDoNotCompileDependencies,
|
||||||
pcfDoNotCompilePackage,pcfCreateMakefile],ShowAbort,nil);
|
pcfDoNotCompilePackage,pcfCreateMakefile],ShowAbort);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgManager.OnRenameFile(const OldFilename, NewFilename: string;
|
function TPkgManager.OnRenameFile(const OldFilename, NewFilename: string;
|
||||||
@ -3983,9 +3975,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// compile all auto install dependencies
|
// compile all auto install dependencies
|
||||||
MiscellaneousOptions.BuildLazProfiles.UpdateGlobals;
|
Result:=PackageGraph.CompileRequiredPackages(nil,Dependencies,[pupAsNeeded]);
|
||||||
Result:=PackageGraph.CompileRequiredPackages(nil,Dependencies,
|
|
||||||
MiscellaneousOptions.BuildLazProfiles.Globals,[pupAsNeeded]);
|
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
|
Loading…
Reference in New Issue
Block a user