mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-04 18:19:31 +01:00
IDE: Move func param PackageOptions to private var and property in TLazarusBuilder.
git-svn-id: trunk@44041 -
This commit is contained in:
parent
3f45e5c0a6
commit
a10c93619c
@ -155,12 +155,12 @@ type
|
||||
TLazarusBuilder = class
|
||||
private
|
||||
fExtraOptions: string;
|
||||
fPackageOptions: string;
|
||||
fUpdateRevInc: boolean;
|
||||
fOutputDirRedirected: boolean;
|
||||
fTargetFilename: string;
|
||||
function CreateIDEMakeOptions(Profile: TBuildLazarusProfile;
|
||||
Macros: TTransferMacroList; const PackageOptions: string;
|
||||
Flags: TBuildLazarusFlags): TModalResult;
|
||||
Macros: TTransferMacroList; Flags: TBuildLazarusFlags): TModalResult;
|
||||
function IsWriteProtected(Profile: TBuildLazarusProfile): Boolean;
|
||||
public
|
||||
function ShowConfigureBuildLazarusDlg(AProfiles: TBuildLazarusProfiles): TModalResult;
|
||||
@ -168,12 +168,13 @@ type
|
||||
function MakeLazarus(Profile: TBuildLazarusProfile;
|
||||
{$IFNDEF EnableNewExtTools}ExternalTools: TBaseExternalToolList;{$ENDIF}
|
||||
Macros: TTransferMacroList;
|
||||
const PackageOptions, CompilerPath, MakePath: string;
|
||||
const CompilerPath, MakePath: string;
|
||||
Flags: TBuildLazarusFlags; var ProfileChanged: boolean): TModalResult;
|
||||
|
||||
function SaveIDEMakeOptions(Profile: TBuildLazarusProfile;
|
||||
Macros: TTransferMacroList;
|
||||
const PackageOptions: string; Flags: TBuildLazarusFlags): TModalResult;
|
||||
Macros: TTransferMacroList; Flags: TBuildLazarusFlags): TModalResult;
|
||||
public
|
||||
property PackageOptions: string read fPackageOptions write fPackageOptions;
|
||||
end;
|
||||
|
||||
function GetMakeIDEConfigFilename: string;
|
||||
@ -224,7 +225,7 @@ end;
|
||||
function TLazarusBuilder.MakeLazarus(Profile: TBuildLazarusProfile;
|
||||
{$IFNDEF EnableNewExtTools}ExternalTools: TBaseExternalToolList;{$ENDIF}
|
||||
Macros: TTransferMacroList;
|
||||
const PackageOptions, CompilerPath, MakePath: string;
|
||||
const CompilerPath, MakePath: string;
|
||||
Flags: TBuildLazarusFlags; var ProfileChanged: boolean): TModalResult;
|
||||
|
||||
procedure ApplyCleanOnce;
|
||||
@ -463,7 +464,7 @@ begin
|
||||
Cmd:='cleanide ide';
|
||||
// append extra Profile
|
||||
fExtraOptions:='';
|
||||
Result:=CreateIDEMakeOptions(Profile,Macros,PackageOptions,Flags);
|
||||
Result:=CreateIDEMakeOptions(Profile,Macros,Flags);
|
||||
if Result<>mrOk then exit;
|
||||
|
||||
if (not fOutputDirRedirected) and (not CheckDirectoryWritable(WorkingDirectory)) then
|
||||
@ -498,8 +499,7 @@ begin
|
||||
end;
|
||||
|
||||
function TLazarusBuilder.CreateIDEMakeOptions(Profile: TBuildLazarusProfile;
|
||||
Macros: TTransferMacroList; const PackageOptions: string;
|
||||
Flags: TBuildLazarusFlags): TModalResult;
|
||||
Macros: TTransferMacroList; Flags: TBuildLazarusFlags): TModalResult;
|
||||
|
||||
procedure BackupExe(var ExeFilename: string);
|
||||
var
|
||||
@ -792,9 +792,9 @@ begin
|
||||
end;
|
||||
|
||||
// add package Profile for IDE
|
||||
//DebugLn(['CreateBuildLazarusOptions blfUseMakeIDECfg=',blfUseMakeIDECfg in FLags,' ExtraOptions="',fExtraOptions,'" ',PackageOptions]);
|
||||
//DebugLn(['CreateBuildLazarusOptions blfUseMakeIDECfg=',blfUseMakeIDECfg in FLags,' ExtraOptions="',fExtraOptions,'" ',fPackageOptions]);
|
||||
if not (blfUseMakeIDECfg in Flags) then
|
||||
AppendExtraOption(PackageOptions,false);
|
||||
AppendExtraOption(fPackageOptions,false);
|
||||
//DebugLn(['CreateBuildLazarusOptions ',MMDef.Name,' ',fExtraOptions]);
|
||||
end;
|
||||
|
||||
@ -803,16 +803,16 @@ function TLazarusBuilder.IsWriteProtected(Profile: TBuildLazarusProfile): Boolea
|
||||
var
|
||||
ModRes: TModalResult;
|
||||
begin
|
||||
ModRes := CreateIDEMakeOptions(Profile, GlobalMacroList, '', []);
|
||||
fPackageOptions:='';
|
||||
ModRes:=CreateIDEMakeOptions(Profile, GlobalMacroList, []);
|
||||
if ModRes in [mrOk,mrIgnore] then
|
||||
Result := fOutputDirRedirected
|
||||
Result:=fOutputDirRedirected
|
||||
else
|
||||
Result := True;
|
||||
Result:=True;
|
||||
end;
|
||||
|
||||
function TLazarusBuilder.SaveIDEMakeOptions(Profile: TBuildLazarusProfile;
|
||||
Macros: TTransferMacroList;
|
||||
const PackageOptions: string; Flags: TBuildLazarusFlags): TModalResult;
|
||||
Macros: TTransferMacroList; Flags: TBuildLazarusFlags): TModalResult;
|
||||
|
||||
function BreakOptions(const OptionString: string): string;
|
||||
var
|
||||
@ -868,7 +868,7 @@ var
|
||||
OptionsAsText: String;
|
||||
begin
|
||||
fExtraOptions:='';
|
||||
Result:=CreateIDEMakeOptions(Profile, Macros, PackageOptions, Flags);
|
||||
Result:=CreateIDEMakeOptions(Profile, Macros, Flags);
|
||||
if Result<>mrOk then exit;
|
||||
Filename:=GetMakeIDEConfigFilename;
|
||||
try
|
||||
|
||||
@ -502,7 +502,6 @@ var
|
||||
CurResult: TModalResult;
|
||||
BuildLazProfiles: TBuildLazarusProfiles;
|
||||
CurProf: TBuildLazarusProfile;
|
||||
PkgOptions: String;
|
||||
InheritedOptionStrings: TInheritedCompOptsStrings;
|
||||
TargetDir: String;
|
||||
i: Integer;
|
||||
@ -582,9 +581,10 @@ begin
|
||||
try
|
||||
ProfileChanged:=false;
|
||||
if BuildLazProfiles.Current.IdeBuildMode=bmCleanAllBuild then begin
|
||||
Builder.PackageOptions:='';
|
||||
CurResult:=Builder.MakeLazarus(BuildLazProfiles.Current,
|
||||
EnvironmentOptions.ExternalTools,GlobalMacroList,
|
||||
'',EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedMakeFilename,
|
||||
Flags+[blfDontBuild],ProfileChanged);
|
||||
if CurResult<>mrOk then begin
|
||||
@ -611,11 +611,11 @@ begin
|
||||
end;
|
||||
|
||||
// create inherited compiler options
|
||||
PkgOptions:=PackageGraph.GetIDEInstallPackageOptions(InheritedOptionStrings{%H-});
|
||||
Builder.PackageOptions:=PackageGraph.GetIDEInstallPackageOptions(InheritedOptionStrings{%H-});
|
||||
|
||||
// save
|
||||
CurResult:=Builder.SaveIDEMakeOptions(BuildLazProfiles.Current,GlobalMacroList,
|
||||
PkgOptions,Flags+[blfBackupOldExe]);
|
||||
Flags+[blfBackupOldExe]);
|
||||
if CurResult<>mrOk then begin
|
||||
if ConsoleVerbosity>=-1 then
|
||||
DebugLn('TLazBuildApplication.BuildLazarusIDE: failed saving idemake.cfg');
|
||||
@ -625,7 +625,7 @@ begin
|
||||
// compile IDE
|
||||
CurResult:=Builder.MakeLazarus(BuildLazProfiles.Current,
|
||||
EnvironmentOptions.ExternalTools,GlobalMacroList,
|
||||
PkgOptions,EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedMakeFilename,
|
||||
Flags+[blfUseMakeIDECfg,blfOnlyIDE],
|
||||
ProfileChanged);
|
||||
|
||||
23
ide/main.pp
23
ide/main.pp
@ -7472,7 +7472,6 @@ end;
|
||||
|
||||
function TMainIDE.DoSaveBuildIDEConfigs(Flags: TBuildLazarusFlags): TModalResult;
|
||||
var
|
||||
PkgOptions: string;
|
||||
InheritedOptionStrings: TInheritedCompOptsStrings;
|
||||
FPCVersion, FPCRelease, FPCPatch: integer;
|
||||
Builder: TLazarusBuilder;
|
||||
@ -7481,11 +7480,6 @@ begin
|
||||
Result:=PkgBoss.DoSaveAutoInstallConfig;
|
||||
if Result<>mrOk then exit;
|
||||
|
||||
// prepare static auto install packages
|
||||
PkgOptions:='';
|
||||
// create inherited compiler options
|
||||
PkgOptions:=PackageGraph.GetIDEInstallPackageOptions(InheritedOptionStrings);
|
||||
|
||||
// check ambiguous units
|
||||
CodeToolBoss.GetFPCVersionForDirectory(
|
||||
EnvironmentOptions.GetParsedLazarusDirectory,
|
||||
@ -7495,8 +7489,13 @@ begin
|
||||
// save extra options
|
||||
Builder:=TLazarusBuilder.Create;
|
||||
try
|
||||
// prepare static auto install packages
|
||||
//PkgOptions:='';
|
||||
// create inherited compiler options
|
||||
Builder.PackageOptions:=PackageGraph.GetIDEInstallPackageOptions(InheritedOptionStrings);
|
||||
|
||||
Result:=Builder.SaveIDEMakeOptions(MiscellaneousOptions.BuildLazProfiles.Current,
|
||||
GlobalMacroList,PkgOptions,Flags+[blfOnlyIDE]);
|
||||
GlobalMacroList,Flags+[blfOnlyIDE]);
|
||||
finally
|
||||
Builder.Free;
|
||||
end;
|
||||
@ -7509,7 +7508,6 @@ end;
|
||||
|
||||
function TMainIDE.DoBuildLazarusSub(Flags: TBuildLazarusFlags): TModalResult;
|
||||
var
|
||||
PkgOptions: string;
|
||||
IDEBuildFlags: TBuildLazarusFlags;
|
||||
InheritedOptionStrings: TInheritedCompOptsStrings;
|
||||
CompiledUnitExt: String;
|
||||
@ -7547,10 +7545,11 @@ begin
|
||||
PkgCompileFlags:=PkgCompileFlags+[pcfCompileDependenciesClean];
|
||||
if BuildLazProfiles.Current.IdeBuildMode=bmCleanAllBuild then begin
|
||||
SourceEditorManager.ClearErrorLines;
|
||||
fBuilder.PackageOptions:='';
|
||||
Result:=fBuilder.MakeLazarus(BuildLazProfiles.Current,
|
||||
{$IFNDEF EnableNewExtTools}ExternalTools,{$ENDIF}
|
||||
GlobalMacroList,
|
||||
'',EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedMakeFilename, [blfDontBuild],
|
||||
ProfileChanged);
|
||||
if Result<>mrOk then begin
|
||||
@ -7575,7 +7574,7 @@ begin
|
||||
end;
|
||||
|
||||
// create inherited compiler options
|
||||
PkgOptions:=PackageGraph.GetIDEInstallPackageOptions(InheritedOptionStrings);
|
||||
fBuilder.PackageOptions:=PackageGraph.GetIDEInstallPackageOptions(InheritedOptionStrings);
|
||||
|
||||
// check ambiguous units
|
||||
CodeToolBoss.GetFPCVersionForDirectory(EnvironmentOptions.GetParsedLazarusDirectory,
|
||||
@ -7593,7 +7592,7 @@ begin
|
||||
|
||||
// save extra options
|
||||
IDEBuildFlags:=Flags;
|
||||
Result:=fBuilder.SaveIDEMakeOptions(BuildLazProfiles.Current,GlobalMacroList,PkgOptions,
|
||||
Result:=fBuilder.SaveIDEMakeOptions(BuildLazProfiles.Current,GlobalMacroList,
|
||||
IDEBuildFlags-[blfUseMakeIDECfg,blfDontClean]+[blfBackupOldExe]);
|
||||
if Result<>mrOk then begin
|
||||
DebugLn('TMainIDE.DoBuildLazarus: Save IDEMake options failed.');
|
||||
@ -7606,7 +7605,7 @@ begin
|
||||
Result:=fBuilder.MakeLazarus(BuildLazProfiles.Current,
|
||||
{$IFNDEF EnableNewExtTools}ExternalTools,{$ENDIF}
|
||||
GlobalMacroList,
|
||||
PkgOptions,EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedCompilerFilename,
|
||||
EnvironmentOptions.GetParsedMakeFilename,IDEBuildFlags,
|
||||
ProfileChanged);
|
||||
if Result<>mrOk then exit;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user