LazBuild: Improve case sensitivity of options. From n7800.

This commit is contained in:
Juha 2024-03-12 08:03:10 +02:00
parent 2cf13d8ba4
commit 69a432d864

View File

@ -798,15 +798,14 @@ var
// apply options
MainBuildBoss.SetBuildTargetProject1(true,smsfsSkip);
if HasOption('get-expand-text') then begin
S:=GetOptionValue('get-expand-text');
if HasLongOptIgnoreCase('get-expand-text',S) then begin
Project1.MacroEngine.SubstituteStr(S);
WriteLn(S);
exit(true);
end;
TargetExeName := Project1.CompilerOptions.CreateTargetFilename;
if HasOption('get-target-path') then begin
if HasLongOptIgnoreCase('get-target-path',S) then begin
WriteLn(TargetExeName);
exit(true);
end;
@ -941,6 +940,7 @@ var
i, MatchCount: Integer;
ModeMask: TMask;
CurResult: Boolean;
S: string;
begin
Result:=false;
CloseProject(Project1);
@ -957,7 +957,7 @@ begin
else
CompReason:= crCompile;
if HasOption('get-build-modes') then begin
if HasLongOptIgnoreCase('get-build-modes',S) then begin
ShowBuildModes;
exit(true);
end;
@ -1188,15 +1188,15 @@ end;
procedure TLazBuildApplication.LoadEnvironmentOptions;
var
Note: string;
Note, Lang: string;
begin
EnvironmentOptions.CreateConfig;
EnvironmentOptions.Load(false);
fCompilerInCfg:=EnvironmentOptions.CompilerFilename;
fLazarusDirInCfg:=EnvironmentOptions.LazarusDirectory;
if HasOption('language') then
EnvironmentOptions.LanguageID:=GetOptionValue('language');
if HasLongOptIgnoreCase('language',Lang) then
EnvironmentOptions.LanguageID:=Lang;
TranslateResourceStrings(EnvironmentOptions.GetParsedLazarusDirectory,
EnvironmentOptions.LanguageID);
if CompilerOverride<>'' then
@ -1731,8 +1731,7 @@ const
end;
begin
if LazBuildApp.HasOption('language') then
CustomLang:=LazBuildApp.GetOptionValue('language');
if HasLongOptIgnoreCase('language',CustomLang) then
TranslateResourceStrings(ProgramDirectoryWithBundle,CustomLang);
writeln('');
writeln(lisLazbuildOptionsSyntax);