lazbuild: show active build mode, fixed build mode comparing name with ansicomparetext

git-svn-id: trunk@36070 -
This commit is contained in:
mattias 2012-03-16 08:17:33 +00:00
parent ed33ab735e
commit d44b3fb55e
2 changed files with 14 additions and 12 deletions

View File

@ -333,15 +333,10 @@ begin
end;
function TBuildLazarusProfiles.IndexByName(AName: string): integer;
var
i: Integer;
begin
Result:=-1;
for i:=0 to Count-1 do
if Items[i].Name=AName then begin
Result:=i;
break;
end;
Result:=Count-1;
while (Result>=0) and (AnsiCompareText(Items[Result].Name,AName)<>0) do
dec(Result);
end;
function TBuildLazarusProfiles.CreateDefaults: integer;

View File

@ -412,6 +412,7 @@ begin
LoadMiscellaneousOptions;
BuildLazProfiles:=MiscellaneousOptions.BuildLazProfiles;
CurProf:=BuildLazProfiles.Current;
if BuildModeOverride<>'' then
begin
i:=BuildLazProfiles.IndexByName(BuildModeOverride);
@ -419,15 +420,21 @@ begin
begin
debugln(['ERROR: IDE build mode "'+BuildModeOverride+'" not found']);
debugln;
debugln('Available IDE buld modes:');
debugln('Available IDE build modes:');
for i:=0 to BuildLazProfiles.Count-1 do
debugln(' ',BuildLazProfiles[i].Name);
begin
if BuildLazProfiles[i]=CurProf then
dbgout('* ')
else
dbgout(' ');
debugln(BuildLazProfiles[i].Name);
end;
debugln;
exit;
end;
CurProf:=BuildLazProfiles[i];
end else
CurProf:=BuildLazProfiles.Current;
end;
debugln(['Building Lazarus IDE with profile "',CurProf.Name,'"']);
if (Length(OSOverride) <> 0) then
CurProf.TargetOS:=OSOverride;