From 7bf6ee77c5dfee8917d7463552a23855585a22ca Mon Sep 17 00:00:00 2001 From: n7800 <14154601-n7800@users.noreply.gitlab.com> Date: Thu, 18 Jul 2024 05:06:34 +0500 Subject: [PATCH] ShowCompilerOpts: Show the compiler path and main project file first in the list of options --- ide/showcompileropts.pas | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ide/showcompileropts.pas b/ide/showcompileropts.pas index 1302063476..ec2e9b32af 100644 --- a/ide/showcompileropts.pas +++ b/ide/showcompileropts.pas @@ -300,15 +300,25 @@ var begin if CompilerOpts=nil then exit; + // set flags Flags:=CompilerOpts.DefaultMakeOptionsFlags; + Include(Flags, ccloAddCompilerPath); if not RelativePathsCheckBox.Checked then Include(Flags,ccloAbsolutePaths); + + // get command line parameters (include compiler path) CompOptions := CompilerOpts.MakeCompilerParams(Flags); try - CompPath:=CompilerOpts.ParsedOpts.GetParsedValue(pcosCompilerPath); - if Pos(' ',CompPath)>0 then - CompPath:=QuotedStr(CompPath); - CompOptions.Add(CompPath); + // add the main project unit after the compiler path + if (Project1<>nil) and (Project1.MainUnitInfo<>nil) and (CompOptions.Count>0) then + begin + if RelativePathsCheckBox.Checked then + CompOptions.Insert(1, Project1.MainUnitInfo.ShortFilename) + else + CompOptions.Insert(1, Project1.MainUnitInfo.GetFullFilename); + end; + + // show FillMemo(CmdLineMemo,CompOptions); finally CompOptions.Free;