mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 22:39:14 +02:00
IDE/lazbuild: build IDE: fixed passing options twice, order: packages, profile, target
git-svn-id: trunk@48443 -
This commit is contained in:
parent
ba549190fe
commit
2dc3f24423
@ -418,6 +418,7 @@ begin
|
||||
Result:=mrCancel;
|
||||
fProfile:=Profile;
|
||||
if CalcTargets(Flags)<>mrOk then exit;
|
||||
debugln(['TLazarusBuilder.MakeLazarus AAA1 ',fExtraOptions]);
|
||||
|
||||
if LazarusIDE<>nil then
|
||||
LazarusIDE.MainBarSubTitle:=Profile.Name;
|
||||
@ -570,16 +571,20 @@ begin
|
||||
fOutputDirRedirected:=False;
|
||||
fUpdateRevInc:=fProfile.UpdateRevisionInc;
|
||||
|
||||
// create extra options
|
||||
fExtraOptions:=fProfile.ExtraOptions;
|
||||
fExtraOptions:='';
|
||||
|
||||
// check for special IDE config file
|
||||
//DebugLn(['CreateIDEMakeOptions blfUseMakeIDECfg=',blfUseMakeIDECfg in FLags,' ExtraOptions="',fExtraOptions,'" ',fPackageOptions]);
|
||||
if (blfUseMakeIDECfg in Flags) then
|
||||
SpecialIdeConfig
|
||||
else if not (blfUseMakeIDECfg in Flags) then
|
||||
begin
|
||||
SpecialIdeConfig;
|
||||
end
|
||||
else begin
|
||||
AppendExtraOption(fPackageOptions,false);
|
||||
|
||||
// write full file names and message ids
|
||||
AppendExtraOption('-vbq');
|
||||
|
||||
{$IFDEF Windows}
|
||||
if (fProfile.TargetPlatform=lpWin32)
|
||||
and (Win32MajorVersion <=4)
|
||||
@ -587,6 +592,9 @@ begin
|
||||
AppendExtraOption('-dWIN9XPLATFORM');
|
||||
{$ENDIF}
|
||||
|
||||
AppendExtraOption(fProfile.ExtraOptions,false);
|
||||
end;
|
||||
|
||||
// set target filename and target directory:
|
||||
// 1. the user has set a target directory
|
||||
// 2. For crosscompiling the IDE needs a different directory
|
||||
@ -614,11 +622,6 @@ begin
|
||||
if fTargetCPU='' then fTargetCPU:=fCompilerTargetCPU;
|
||||
LazDir:=EnvironmentOptions.GetParsedLazarusDirectory;
|
||||
|
||||
if fTargetOS<>fCompilerTargetOS then
|
||||
AppendExtraOption('-T'+fTargetOS);
|
||||
if fTargetCPU<>fCompilerTargetCPU then
|
||||
AppendExtraOption('-P'+fTargetCPU);
|
||||
|
||||
//DebugLn(['CalcTargets NewTargetOS=',fTargetOS,' NewTargetCPU=',fTargetCPU]);
|
||||
if (fProfile.TargetDirectory<>'') then begin
|
||||
// Case 1. the user has set a target directory
|
||||
@ -699,8 +702,13 @@ begin
|
||||
fOutputDirRedirected:=CompareFilenames(ChompPathDelim(LazDir),
|
||||
ChompPathDelim(fTargetDir))<>0;
|
||||
|
||||
// write full file names and message ids
|
||||
AppendExtraOption('-vbq');
|
||||
// append target options
|
||||
if not (blfUseMakeIDECfg in Flags) then
|
||||
begin
|
||||
if fTargetOS<>fCompilerTargetOS then
|
||||
AppendExtraOption('-T'+fTargetOS);
|
||||
if fTargetCPU<>fCompilerTargetCPU then
|
||||
AppendExtraOption('-P'+fTargetCPU);
|
||||
|
||||
if fUnitOutDir<>'' then
|
||||
// FPC interpretes '\ ' as an escape for a space in a path on Windows,
|
||||
@ -719,6 +727,7 @@ begin
|
||||
DefaultTargetFilename:='lazarus'+GetExecutableExt(fTargetOS);
|
||||
if CreateRelativePath(fTargetFilename,fTargetDir) <> DefaultTargetFilename then
|
||||
AppendExtraOption('-o'+fTargetFilename);
|
||||
end;
|
||||
|
||||
//DebugLn(['CreateIDEMakeOptions ',MMDef.Name,' ',fExtraOptions]);
|
||||
end;
|
||||
@ -907,7 +916,7 @@ var
|
||||
begin
|
||||
Result:=mrCancel;
|
||||
fProfile:=Profile;
|
||||
if CalcTargets(Flags)<>mrOk then exit;
|
||||
if CalcTargets(Flags-[blfUseMakeIDECfg])<>mrOk then exit;
|
||||
|
||||
Result:=PrepareTargetDir(Flags);
|
||||
if Result<>mrOk then exit;
|
||||
|
@ -7395,7 +7395,7 @@ begin
|
||||
// save extra options
|
||||
IDEBuildFlags:=Flags;
|
||||
Result:=fBuilder.SaveIDEMakeOptions(BuildLazProfiles.Current,
|
||||
IDEBuildFlags-[blfUseMakeIDECfg,blfDontClean]+[blfBackupOldExe]);
|
||||
IDEBuildFlags-[blfDontClean]+[blfBackupOldExe]);
|
||||
if Result<>mrOk then begin
|
||||
DebugLn('TMainIDE.DoBuildLazarus: Save IDEMake options failed.');
|
||||
exit;
|
||||
|
Loading…
Reference in New Issue
Block a user