LazBuild: Support case-insensitive options, including contents of lazarus.cfg, like Lazarus does. Issue #40187.

This commit is contained in:
Juha 2023-04-02 16:44:22 +03:00
parent 7dc0983e3c
commit 238e4fb963

View File

@ -194,17 +194,19 @@ procedure FilterConfigFileContent;
var var
l: TStrings; l: TStrings;
i: Integer; i: Integer;
LowerOpt: String;
begin begin
ResetParamsAndCfg; ResetParamsAndCfg;
l := GetCfgFileContent; l := GetCfgFileContent;
if l = nil then exit; if l = nil then exit;
i := l.Count - 1; i := l.Count - 1;
while i >= 0 do begin while i >= 0 do begin
LowerOpt := LowerCase(l[i]);
if not( if not(
(copy(l[i], 1, 22) = '--primary-config-path=') or LazStartsStr('--primary-config-path=', LowerOpt) or
(copy(l[i], 1, 24) = '--secondary-config-path=') or LazStartsStr('--secondary-config-path=', LowerOpt) or
(copy(l[i], 1, 6) = '--pcp=') or LazStartsStr('--pcp=', LowerOpt) or
(copy(l[i], 1, 6) = '--scp=') LazStartsStr('--scp=', LowerOpt)
) )
then then
l.Delete(i); l.Delete(i);
@ -1438,6 +1440,7 @@ end;
constructor TLazBuildApplication.Create(TheOwner: TComponent); constructor TLazBuildApplication.Create(TheOwner: TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
CaseSensitiveOptions:=False;
SetupDialogs; SetupDialogs;
Files:=TStringList.Create; Files:=TStringList.Create;
fMaxProcessCount:=-1; fMaxProcessCount:=-1;