Merge branch 'IDE/Options/ShowCompOpts' into 'main'

ShowCompilerOpts: Show the compiler path and main project file first in the list of options

See merge request freepascal.org/lazarus/lazarus!306
This commit is contained in:
Mattias Gaertner 2024-07-18 07:59:13 +00:00
commit f6653b4638

View File

@ -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;