mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 17:08:01 +02:00
* Undo last change.
This commit is contained in:
parent
9fe395018a
commit
55e72fc0f1
@ -1844,6 +1844,17 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
type
|
||||
TUnsortedDuplicatesStringList = class(TStringList)
|
||||
public
|
||||
function Add(const S: string): Integer; override;
|
||||
end;
|
||||
|
||||
TUnsortedCompilerOptionsStringList = class(TStringList)
|
||||
public
|
||||
constructor Create;
|
||||
end;
|
||||
|
||||
var
|
||||
CustomFpmakeCommandlineOptions: TStrings;
|
||||
CustomFpMakeCommandlineValues: TStrings;
|
||||
@ -2927,7 +2938,7 @@ end;
|
||||
procedure AddCustomFpmakeCommandlineOption(const ACommandLineOption, HelpMessage : string);
|
||||
begin
|
||||
if not assigned(CustomFpmakeCommandlineOptions) then
|
||||
CustomFpmakeCommandlineOptions := TStringList.Create;
|
||||
CustomFpmakeCommandlineOptions := TUnsortedCompilerOptionsStringList.Create;
|
||||
CustomFpmakeCommandlineOptions.Values[ACommandLineOption]:=HelpMessage;
|
||||
end;
|
||||
|
||||
@ -3001,7 +3012,7 @@ begin
|
||||
Result:=Nil;
|
||||
If (S='') then
|
||||
Exit;
|
||||
Result:=TStringList.Create;
|
||||
Result:=TUnsortedCompilerOptionsStringList.Create;
|
||||
Repeat
|
||||
P:=Pos(' ',S);
|
||||
If P=0 then
|
||||
@ -3591,7 +3602,7 @@ constructor TPackageVariant.Create(ACollection: TCollection);
|
||||
begin
|
||||
inherited Create(ACollection);
|
||||
FTargets := TTargets.Create(TTarget);
|
||||
FOptions := TStringList.Create;
|
||||
FOptions := TUnsortedCompilerOptionsStringList.Create;
|
||||
FIncludePath:=TConditionalStrings.Create(TConditionalString);
|
||||
FSourcePath:=TConditionalStrings.Create(TConditionalString);
|
||||
end;
|
||||
@ -3781,6 +3792,32 @@ end;
|
||||
|
||||
{$endif NO_THREADING}
|
||||
|
||||
{****************************************************************************
|
||||
TUnsortedDuplicatesStringList
|
||||
****************************************************************************}
|
||||
|
||||
function TUnsortedDuplicatesStringList.Add(const S: string): Integer;
|
||||
|
||||
begin
|
||||
result := IndexOf(S);
|
||||
If result > -1 then
|
||||
Case DUplicates of
|
||||
DupAccept,
|
||||
DupIgnore : Exit;
|
||||
DupError : Error(SDuplicateString,0)
|
||||
end;
|
||||
inherited Add(S);
|
||||
end;
|
||||
|
||||
{****************************************************************************
|
||||
TUnsortedCompilerOptionsStringList
|
||||
****************************************************************************}
|
||||
|
||||
constructor TUnsortedCompilerOptionsStringList.Create;
|
||||
begin
|
||||
Inherited Create;
|
||||
Duplicates:=DupAccept;
|
||||
end;
|
||||
|
||||
{****************************************************************************
|
||||
TNamedItem
|
||||
@ -4601,14 +4638,14 @@ end;
|
||||
function TPackage.GetOptions: TStrings;
|
||||
begin
|
||||
If (FOptions=Nil) then
|
||||
FOptions:=TStringList.Create;
|
||||
FOptions:=TUnsortedCompilerOptionsStringList.Create;
|
||||
Result:=FOptions;
|
||||
end;
|
||||
|
||||
function TPackage.GetTransmitOptions: TStrings;
|
||||
begin
|
||||
If (FTransmitOptions=Nil) then
|
||||
FTransmitOptions:=TStringList.Create;
|
||||
FTransmitOptions:=TUnsortedCompilerOptionsStringList.Create;
|
||||
Result:=FTransmitOptions;
|
||||
end;
|
||||
|
||||
@ -4778,7 +4815,7 @@ Var
|
||||
T : TTarget;
|
||||
S, O, FN : String;
|
||||
SL : TStringList;
|
||||
L : TStringList;
|
||||
L : TUnsortedDuplicatesStringList;
|
||||
I : Integer;
|
||||
iCPU : TCPU;
|
||||
iOS : TOS;
|
||||
@ -4809,7 +4846,7 @@ begin
|
||||
SL.Add('-dUNIX');
|
||||
SL.Add('-M'+ModeToString(T.Mode));
|
||||
// Include Path
|
||||
L:=TStringList.Create;
|
||||
L:=TUnsortedDuplicatesStringList.Create;
|
||||
L.Duplicates:=dupIgnore;
|
||||
AddDependencyPaths(L,depInclude,T);
|
||||
AddConditionalStrings(P, L,P.IncludePath,Defaults.CompileTarget);
|
||||
@ -5366,7 +5403,7 @@ end;
|
||||
function TCustomDefaults.GetOptions: TStrings;
|
||||
begin
|
||||
If (FOptions=Nil) then
|
||||
FOptions:=TStringList.Create;
|
||||
FOptions:=TUnsortedCompilerOptionsStringList.Create;
|
||||
Result:=FOptions;
|
||||
end;
|
||||
|
||||
@ -6338,7 +6375,7 @@ begin
|
||||
else if assigned(CustomFpmakeCommandlineOptions) and CheckCustomOption(I,CustOptName) then
|
||||
begin
|
||||
if not assigned(CustomFpMakeCommandlineValues) then
|
||||
CustomFpMakeCommandlineValues := TStringList.Create;
|
||||
CustomFpMakeCommandlineValues := TUnsortedCompilerOptionsStringList.Create;
|
||||
CustomFpMakeCommandlineValues.Values[CustOptName]:=OptionArg(I, true)
|
||||
end
|
||||
else if (not CheckBuildOptionSetValue(I)) and (not CheckPackageVariantOptionSetValue(I))
|
||||
@ -7915,7 +7952,7 @@ procedure TBuildEngine.GetCompilerCommand(Args: TStrings; APackage: TPackage;
|
||||
ATarget: TTarget; Env: TStrings);
|
||||
|
||||
Var
|
||||
L : TStringList;
|
||||
L : TUnsortedDuplicatesStringList;
|
||||
s : string;
|
||||
ExtCmd,ErrS: string;
|
||||
i : Integer;
|
||||
@ -7949,7 +7986,7 @@ begin
|
||||
Args.Add('-FE'+AddPathPrefix(APackage,APackage.GetBinOutputDir(Defaults.CompileTarget)));
|
||||
Args.Add('-FU'+AddPathPrefix(APackage,APackage.GetUnitsOutputDir(Defaults.CompileTarget)));
|
||||
// Object Path
|
||||
L:=TStringList.Create;
|
||||
L:=TUnsortedDuplicatesStringList.Create;
|
||||
L.Duplicates:=dupIgnore;
|
||||
AddConditionalStrings(APackage, L,APackage.ObjectPath, Defaults.CompileTarget);
|
||||
AddConditionalStrings(APackage, L,ATarget.ObjectPath, Defaults.CompileTarget);
|
||||
@ -7957,7 +7994,7 @@ begin
|
||||
Args.Add('-Fo'+AddPathPrefix(APackage,L[i]));
|
||||
FreeAndNil(L);
|
||||
// Unit Dirs
|
||||
L:=TStringList.Create;
|
||||
L:=TUnsortedDuplicatesStringList.Create;
|
||||
L.Duplicates:=dupIgnore;
|
||||
AddDependencyUnitPaths(L,APackage);
|
||||
AddDependencyPaths(L,depUnit,ATarget);
|
||||
@ -7967,7 +8004,7 @@ begin
|
||||
Args.Add('-Fu'+AddPathPrefix(APackage,L[i]));
|
||||
FreeAndNil(L);
|
||||
// Include Path
|
||||
L:=TStringList.Create;
|
||||
L:=TUnsortedDuplicatesStringList.Create;
|
||||
L.Duplicates:=dupIgnore;
|
||||
AddDependencyPaths(L,depInclude,ATarget);
|
||||
AddConditionalStrings(APackage, L,APackage.IncludePath, Defaults.CompileTarget);
|
||||
@ -9350,7 +9387,7 @@ Var
|
||||
RemainingList : TStrings;
|
||||
i : longint;
|
||||
begin
|
||||
List:=TStringList.Create;
|
||||
List:=TUnsortedDuplicatesStringList.Create;
|
||||
List.Duplicates:=DupIgnore;
|
||||
try
|
||||
List.Add(APackage.GetUnitConfigOutputFilename(aTarget));
|
||||
@ -9358,7 +9395,7 @@ begin
|
||||
if (List.Count>0) then
|
||||
begin
|
||||
CmdDeleteFiles(List);
|
||||
DirectoryList:=TStringList.Create;
|
||||
DirectoryList:=TUnsortedDuplicatesStringList.Create;
|
||||
DirectoryList.Duplicates:=DupIgnore;
|
||||
try
|
||||
GetDirectoriesFromFilelist(List,DirectoryList);
|
||||
@ -10071,7 +10108,7 @@ end;
|
||||
function TTarget.GetOptions: TStrings;
|
||||
begin
|
||||
If Foptions=Nil then
|
||||
FOptions:=TStringList.Create;
|
||||
FOptions:=TUnsortedCompilerOptionsStringList.Create;
|
||||
Result:=FOptions;
|
||||
end;
|
||||
|
||||
@ -11084,7 +11121,7 @@ end;
|
||||
function TCommand.GetOptions: TStrings;
|
||||
begin
|
||||
If (FOptions=Nil) then
|
||||
FOptions:=TStringList.Create;
|
||||
FOptions:=TUnsortedCompilerOptionsStringList.Create;
|
||||
Result:=FOptions;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user