<p style="padding:0 0 0 0; margin:0 0 0 0;">Hi,</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">I see now, FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetType is never called. Result depends on parameter LCLWidgetType of function TBuildManager.SetBuildTarget().</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">This code:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">procedure TMainIDE.mnuToolConfigBuildLazClicked(Sender: TObject);</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">var</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> ...</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">begin</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> //if ToolStatus<>itNone then exit;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> if fBuilder=Nil then</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> fBuilder:=TLazarusBuilder.Create; // Will be freed in the very end.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> MainBuildBoss.SetBuildTargetIDE;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> try</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> DlgResult:=fBuilder.ShowConfigureBuildLazarusDlg(MiscellaneousOptions.BuildLazProfiles);</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> finally</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 10pt;"> MainBuildBoss.SetBuildTargetProject1(true);</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 10pt;"> end;</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 10pt;">SetBuildTargetIDE calls SetBuildTarget with correct parameters but in turn in finally section SetBuildTargetProject1 calls:</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">SetBuildTarget('','','',ScanFPCSrc,Quiet); //note that empty strings</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">It later calls:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">function GetDefaultLCLWidgetType: TLCLPlatform;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">begin</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 10pt;"> if (WidgetSet<>nil) and (WidgetSet.LCLPlatform<>lpNoGUI) then</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> Result:=WidgetSet.LCLPlatform</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> else</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> Result:=BuildLCLWidgetType;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 10pt;">end;</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 10pt;">where WidgetSet is always assigned and Result is always gtk2.</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span style="font-size: 10pt;">V.</span></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Mattias Gaertner via Lazarus <lazarus@lists.lazarus-ide.org><br />
> Komu: lazarus@lists.lazarus-ide.org<br />
> Datum: 05.01.2018 13:11<br />
> Předmět: Re: [Lazarus] Rebuilding IDE Gtk/Qt<br />
></p>
On Fri, 05 Jan 2018 02:59:56 +0100<br />
Vojtěch Čihák via Lazarus <lazarus@lists.lazarus-ide.org> wrote:<br />
<br />
> I found the reason but to make a patch is beyond my powers.<br />
> When I used the steps described below, I got this in console:<br />
>[...]is unchangedThe changes come from method MainBuildBoss.SetBuildTargetProject1 which is called several times in main.pp, mainly in TMainIDE.mnuToolConfigBuildLazClicked at line 4595.<br />
<br />
Yes, these are the switches between project and IDE settings.<br />
<br />
> It calls TBuildManager.SetBuildTarget and nested function GetEffectiveLCLWidgetType where is line: Result:=FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetTypeIt is probably the reason why combobox in "Configure Build Lazarus" is ignored and is replaced by value from Compiler Options.<br />
<br />
No, when building the IDE the FBuildTarget is nil.<br />
See TBuildManager.SetBuildTargetIDE.<br />
<br />
Please start the IDE with -v -v to get more output.<br />
<br />
Mattias<br />
<br />
<br />
-- <br />
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus-ide.org<br />
<a href="https://lists.lazarus-ide.org/listinfo/lazarus">https://lists.lazarus-ide.org/listinfo/lazarus</a><br />