LazBuild: Take into account the combined values of the --build-ide and --opt options

This commit is contained in:
n7800 2024-09-28 01:50:29 +05:00 committed by Juha
parent ad85d36b04
commit fc90be95ce
2 changed files with 14 additions and 10 deletions

View File

@ -172,7 +172,9 @@ resourcestring
'info file after build. If not specified, build number will be incremented '+
'if configured.';
lisExtraOpts = 'Pass additional options to the compiler';
lisExtraOpts = 'Pass additional options to the compiler. If compilation '+
'options are also specified in --build-ide, then the options from --opt '+
'will be added after them.';
lisGetExpandText = 'Print the result of substituting macros in the text. '+
'The absence of macros in the text means the name of the macro. '+
'By default, active build mode is used.';
@ -5339,7 +5341,9 @@ resourcestring
+'list of installed packages (combine with --build-ide to rebuild IDE).';
lisWriteWhatPackageFilesAreS = 'Write what package files are searched and '
+'found.';
lisBuildIDEWithPackages = 'Build IDE with packages.';
lisBuildIDEWithPackages = 'Build IDE with packages. Optional compiler options '+
'can be specified to be passed after the build mode options, or they can be '+
'specified with the --opt option';
lisShowVersionAndExit = 'Show version and exit.';
lisBeLessVerboseCanBeGivenMultipleTimes = 'Be less verbose. Can be given '
+'multiple times.';

View File

@ -608,14 +608,14 @@ begin
CurProf.TargetPlatform:=DirNameToLCLPlatform(WidgetSetOverride)
else
CurProf.TargetPlatform:=GetBuildLCLWidgetType;
if BuildIDEOptions<>'' then
begin
s:=CurProf.ExtraOptions;
if s<>'' then
s+=' ';
s+=BuildIDEOptions;
CurProf.ExtraOptions:=s;
end;
// add custom options from --build-ide after build mode options
if BuildIDEOptions <> '' then
CurProf.ExtraOptions := MergeCustomOptions(CurProf.ExtraOptions, BuildIDEOptions);
// add parameters from the --opt option after --build-ide, as higher priority
if HasLongOptIgnoreCase('opt', s) then
CurProf.ExtraOptions := MergeCustomOptions(CurProf.ExtraOptions, s);
if BuildAll then
CurProf.IdeBuildMode:=bmCleanAllBuild;
MainBuildBoss.SetBuildTargetIDE;