mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 00:54:03 +02:00
IDE: Use a private var fProfile instead of method parameters in TLazarusBuilder.
git-svn-id: trunk@44048 -
This commit is contained in:
parent
8564fcc673
commit
4228a0acd2
@ -173,7 +173,7 @@ type
|
|||||||
// Method used by SaveIDEMakeOptions :
|
// Method used by SaveIDEMakeOptions :
|
||||||
function BreakExtraOptions: string;
|
function BreakExtraOptions: string;
|
||||||
// This is used by MakeLazarus, IsWriteProtected and SaveIDEMakeOptions
|
// This is used by MakeLazarus, IsWriteProtected and SaveIDEMakeOptions
|
||||||
function CreateIDEMakeOptions(Profile: TBuildLazarusProfile; Flags: TBuildLazarusFlags): TModalResult;
|
function CreateIDEMakeOptions(Flags: TBuildLazarusFlags): TModalResult;
|
||||||
public
|
public
|
||||||
{$IFNDEF EnableNewExtTools}
|
{$IFNDEF EnableNewExtTools}
|
||||||
ExternalTools: TBaseExternalToolList;
|
ExternalTools: TBaseExternalToolList;
|
||||||
@ -479,7 +479,7 @@ begin
|
|||||||
Cmd:='cleanide ide';
|
Cmd:='cleanide ide';
|
||||||
// append extra Profile
|
// append extra Profile
|
||||||
fExtraOptions:='';
|
fExtraOptions:='';
|
||||||
Result:=CreateIDEMakeOptions(Profile,Flags);
|
Result:=CreateIDEMakeOptions(Flags);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
|
|
||||||
if (not fOutputDirRedirected) and (not CheckDirectoryWritable(fWorkingDir)) then
|
if (not fOutputDirRedirected) and (not CheckDirectoryWritable(fWorkingDir)) then
|
||||||
@ -513,8 +513,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazarusBuilder.CreateIDEMakeOptions(Profile: TBuildLazarusProfile;
|
function TLazarusBuilder.CreateIDEMakeOptions(Flags: TBuildLazarusFlags): TModalResult;
|
||||||
Flags: TBuildLazarusFlags): TModalResult;
|
|
||||||
|
|
||||||
procedure BackupExe(var ExeFilename: string);
|
procedure BackupExe(var ExeFilename: string);
|
||||||
var
|
var
|
||||||
@ -607,10 +606,10 @@ var
|
|||||||
begin
|
begin
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
fOutputDirRedirected:=false;
|
fOutputDirRedirected:=false;
|
||||||
fUpdateRevInc:=Profile.UpdateRevisionInc;
|
fUpdateRevInc:=fProfile.UpdateRevisionInc;
|
||||||
|
|
||||||
// create extra Profile
|
// create extra Profile
|
||||||
fExtraOptions:=Profile.ExtraOptions;
|
fExtraOptions:=fProfile.ExtraOptions;
|
||||||
|
|
||||||
// check for special IDE config file
|
// check for special IDE config file
|
||||||
if (blfUseMakeIDECfg in Flags) then begin
|
if (blfUseMakeIDECfg in Flags) then begin
|
||||||
@ -655,20 +654,20 @@ begin
|
|||||||
DefaultTargetOS:=GetCompiledTargetOS;
|
DefaultTargetOS:=GetCompiledTargetOS;
|
||||||
if DefaultTargetCPU='' then
|
if DefaultTargetCPU='' then
|
||||||
DefaultTargetCPU:=GetCompiledTargetCPU;
|
DefaultTargetCPU:=GetCompiledTargetCPU;
|
||||||
TargetOS:=Profile.FPCTargetOS;
|
TargetOS:=fProfile.FPCTargetOS;
|
||||||
TargetCPU:=Profile.FPCTargetCPU;
|
TargetCPU:=fProfile.FPCTargetCPU;
|
||||||
TargetLCLPlatform:=LCLPlatformDirNames[Profile.TargetPlatform];
|
TargetLCLPlatform:=LCLPlatformDirNames[fProfile.TargetPlatform];
|
||||||
if TargetOS='' then TargetOS:=DefaultTargetOS;
|
if TargetOS='' then TargetOS:=DefaultTargetOS;
|
||||||
if TargetCPU='' then TargetCPU:=DefaultTargetCPU;
|
if TargetCPU='' then TargetCPU:=DefaultTargetCPU;
|
||||||
DefaultTargetFilename:='lazarus'+GetExecutableExt(TargetOS);
|
DefaultTargetFilename:='lazarus'+GetExecutableExt(TargetOS);
|
||||||
CrossCompiling:=(CompareText(TargetOS,DefaultTargetOS)<>0) or (CompareText(TargetCPU,DefaultTargetCPU)<>0);
|
CrossCompiling:=(CompareText(TargetOS,DefaultTargetOS)<>0) or (CompareText(TargetCPU,DefaultTargetCPU)<>0);
|
||||||
|
|
||||||
//DebugLn(['CreateBuildLazarusOptions NewTargetOS=',TargetOS,' NewTargetCPU=',TargetCPU]);
|
//DebugLn(['CreateBuildLazarusOptions NewTargetOS=',TargetOS,' NewTargetCPU=',TargetCPU]);
|
||||||
if (Profile.TargetDirectory<>'') then begin
|
if (fProfile.TargetDirectory<>'') then begin
|
||||||
// Case 1. the user has set a target directory
|
// Case 1. the user has set a target directory
|
||||||
TargetDirectory:=Profile.GetParsedTargetDirectory(fMacros);
|
TargetDirectory:=fProfile.GetParsedTargetDirectory(fMacros);
|
||||||
if TargetDirectory='' then begin
|
if TargetDirectory='' then begin
|
||||||
debugln('CreateBuildLazarusOptions macro aborted Options.TargetDirectory=',Profile.TargetDirectory);
|
debugln('CreateBuildLazarusOptions macro aborted Options.TargetDirectory=',fProfile.TargetDirectory);
|
||||||
Result:=mrAbort;
|
Result:=mrAbort;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -688,8 +687,8 @@ begin
|
|||||||
// ppu files to <primary config dir>/units/<TargetCPU>-<TargetOS>/<LCLWidgetType>
|
// ppu files to <primary config dir>/units/<TargetCPU>-<TargetOS>/<LCLWidgetType>
|
||||||
UnitOutDir:=AppendPathDelim(GetPrimaryConfigPath)+'units'
|
UnitOutDir:=AppendPathDelim(GetPrimaryConfigPath)+'units'
|
||||||
+PathDelim+TargetCPU+'-'+TargetOS+PathDelim+TargetLCLPlatform;
|
+PathDelim+TargetCPU+'-'+TargetOS+PathDelim+TargetLCLPlatform;
|
||||||
debugln('CreateBuildLazarusOptions Options.TargetOS=',Profile.FPCTargetOS,' Options.TargetCPU=',
|
debugln('CreateBuildLazarusOptions Options.TargetOS=',fProfile.FPCTargetOS,' Options.TargetCPU=',
|
||||||
Profile.FPCTargetCPU,' DefaultOS=',DefaultTargetOS,' DefaultCPU=',DefaultTargetCPU);
|
fProfile.FPCTargetCPU,' DefaultOS=',DefaultTargetOS,' DefaultCPU=',DefaultTargetCPU);
|
||||||
end else begin
|
end else begin
|
||||||
// -> normal compile for this platform
|
// -> normal compile for this platform
|
||||||
|
|
||||||
@ -756,7 +755,7 @@ begin
|
|||||||
|
|
||||||
// create apple bundle if needed
|
// create apple bundle if needed
|
||||||
//debugln(['CreateBuildLazarusOptions NewTargetDirectory=',TargetDirectory]);
|
//debugln(['CreateBuildLazarusOptions NewTargetDirectory=',TargetDirectory]);
|
||||||
if (Profile.TargetPlatform in [lpCarbon,lpCocoa])
|
if (fProfile.TargetPlatform in [lpCarbon,lpCocoa])
|
||||||
and (not NewTargetDirectoryIsDefault)
|
and (not NewTargetDirectoryIsDefault)
|
||||||
and (DirectoryIsWritableCached(TargetDirectory)) then begin
|
and (DirectoryIsWritableCached(TargetDirectory)) then begin
|
||||||
CurTargetFilename:=fTargetFilename;
|
CurTargetFilename:=fTargetFilename;
|
||||||
@ -806,7 +805,7 @@ begin
|
|||||||
AppendExtraOption('-o'+fTargetFilename);
|
AppendExtraOption('-o'+fTargetFilename);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// add package Profile for IDE
|
// add package profile for IDE
|
||||||
//DebugLn(['CreateBuildLazarusOptions blfUseMakeIDECfg=',blfUseMakeIDECfg in FLags,' ExtraOptions="',fExtraOptions,'" ',fPackageOptions]);
|
//DebugLn(['CreateBuildLazarusOptions blfUseMakeIDECfg=',blfUseMakeIDECfg in FLags,' ExtraOptions="',fExtraOptions,'" ',fPackageOptions]);
|
||||||
if not (blfUseMakeIDECfg in Flags) then
|
if not (blfUseMakeIDECfg in Flags) then
|
||||||
AppendExtraOption(fPackageOptions,false);
|
AppendExtraOption(fPackageOptions,false);
|
||||||
@ -818,8 +817,9 @@ function TLazarusBuilder.IsWriteProtected(Profile: TBuildLazarusProfile): Boolea
|
|||||||
var
|
var
|
||||||
ModRes: TModalResult;
|
ModRes: TModalResult;
|
||||||
begin
|
begin
|
||||||
|
fProfile:=Profile;
|
||||||
fPackageOptions:='';
|
fPackageOptions:='';
|
||||||
ModRes:=CreateIDEMakeOptions(Profile,[]);
|
ModRes:=CreateIDEMakeOptions([]);
|
||||||
if ModRes in [mrOk,mrIgnore] then
|
if ModRes in [mrOk,mrIgnore] then
|
||||||
Result:=fOutputDirRedirected
|
Result:=fOutputDirRedirected
|
||||||
else
|
else
|
||||||
@ -881,8 +881,9 @@ var
|
|||||||
fs: TFileStreamUTF8;
|
fs: TFileStreamUTF8;
|
||||||
OptionsAsText: String;
|
OptionsAsText: String;
|
||||||
begin
|
begin
|
||||||
|
fProfile:=Profile;
|
||||||
fExtraOptions:='';
|
fExtraOptions:='';
|
||||||
Result:=CreateIDEMakeOptions(Profile,Flags);
|
Result:=CreateIDEMakeOptions(Flags);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
Filename:=GetMakeIDEConfigFilename;
|
Filename:=GetMakeIDEConfigFilename;
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user