fix #449 - dexed projects, extraSources not expanded correctly anymore

This commit is contained in:
Basile Burg 2019-02-17 09:02:07 +01:00
parent 7151d1ab93
commit 8f782aa57a
1 changed files with 70 additions and 13 deletions

View File

@ -5,7 +5,7 @@ unit u_dmdwrap;
interface interface
uses uses
classes, sysutils, process, asyncprocess, classes, sysutils, process, asyncprocess, LazFileUtils,
u_common, u_processes, u_interfaces; u_common, u_processes, u_interfaces;
(* (*
@ -1061,7 +1061,9 @@ var
e: TStringList; e: TStringList;
s: string; s: string;
i: integer; i: integer;
c: string;
begin begin
c := fSymStringExpander.expand('<CPR>');
e := TStringList.create; e := TStringList.create;
try try
e.AddStrings(['.d','.di']); e.AddStrings(['.d','.di']);
@ -1070,6 +1072,8 @@ begin
s := fExtraSrcs[i]; s := fExtraSrcs[i];
if isStringDisabled(s) then if isStringDisabled(s) then
continue; continue;
if not FilenameIsAbsolute(s) then
s := c + s;
s := fSymStringExpander.expand(s); s := fSymStringExpander.expand(s);
if not listAsteriskPath(s, list, e) then if not listAsteriskPath(s, list, e) then
list.Add(s); list.Add(s);
@ -1085,16 +1089,22 @@ var
exts: TStringList; exts: TStringList;
baseopt: TPathsOpts; baseopt: TPathsOpts;
rightList: TStringList; rightList: TStringList;
i: integer;
c: string;
begin begin
c := fSymStringExpander.expand('<CPR>');
if base.isNil then if base.isNil then
begin begin
exts := TStringList.Create; exts := TStringList.Create;
try try
exts.AddStrings(['.d', '.di', '.dd']); exts.AddStrings(['.d', '.di', '.dd']);
for str in fExtraSrcs do for i := 0 to fExtraSrcs.Count-1 do
begin begin
str := fExtraSrcs[i];
if isStringDisabled(str) then if isStringDisabled(str) then
continue; continue;
if not FilenameIsAbsolute(str) then
str := c + str;
sym := fSymStringExpander.expand(str); sym := fSymStringExpander.expand(str);
if not listAsteriskPath(sym, list, exts) then if not listAsteriskPath(sym, list, exts) then
list.Add(sym); list.Add(sym);
@ -1102,14 +1112,38 @@ begin
finally finally
exts.Free; exts.Free;
end; end;
for str in fImpMod do if not isStringDisabled(str) then for i := 0 to fImpMod.Count-1 do
begin
str := fImpMod[i];
if isStringDisabled(str) then
continue;
if not FilenameIsAbsolute(str) then
str := c + str;
list.Add('-I'+ fSymStringExpander.expand(str)); list.Add('-I'+ fSymStringExpander.expand(str));
for str in fImpStr do if not isStringDisabled(str) then end;
for i := 0 to fImpStr.Count-1 do
begin
str := fImpStr[i];
if isStringDisabled(str) then
continue;
if not FilenameIsAbsolute(str) then
str := c + str;
list.Add('-J'+ fSymStringExpander.expand(str)); list.Add('-J'+ fSymStringExpander.expand(str));
end;
if fFname <> '' then if fFname <> '' then
list.Add('-of' + fSymStringExpander.expand(fFname)); begin
str := fFname;
if not FilenameIsAbsolute(str) then
str := c + str;
list.Add('-of' + fSymStringExpander.expand(str));
end;
if fObjDir <> '' then if fObjDir <> '' then
list.Add('-od' + fSymStringExpander.expand(fObjDir)); begin
str := fObjDir;
if not FilenameIsAbsolute(str) then
str := c + str;
list.Add('-od' + fSymStringExpander.expand(str));
end;
end else end else
begin begin
baseopt := TPathsOpts(base); baseopt := TPathsOpts(base);
@ -1120,10 +1154,13 @@ begin
exts := TStringList.Create; exts := TStringList.Create;
try try
exts.AddStrings(['.d', '.di', '.dd']); exts.AddStrings(['.d', '.di', '.dd']);
for str in rightList do for i := 0 to rightList.Count-1 do
begin begin
str := rightList[i];
if isStringDisabled(str) then if isStringDisabled(str) then
continue; continue;
if not FilenameIsAbsolute(str) then
str := c + str;
sym := fSymStringExpander.expand(str); sym := fSymStringExpander.expand(str);
if not listAsteriskPath(sym, list, exts) then if not listAsteriskPath(sym, list, exts) then
list.Add(sym); list.Add(sym);
@ -1136,17 +1173,29 @@ begin
rightList := baseopt.fImpMod rightList := baseopt.fImpMod
else else
rightList := fImpMod; rightList := fImpMod;
for str in rightList do for i := 0 to rightList.Count-1 do
if not isStringDisabled(str) then begin
str := rightList[i];
if isStringDisabled(str) then
continue;
if not FilenameIsAbsolute(str) then
str := c + str;
list.Add('-I'+ fSymStringExpander.expand(str)); list.Add('-I'+ fSymStringExpander.expand(str));
end;
// //
if fImpStr.Count = 0 then if fImpStr.Count = 0 then
rightList := baseopt.fImpStr rightList := baseopt.fImpStr
else else
rightList := fImpStr; rightList := fImpStr;
for str in rightList do for i := 0 to rightList.Count-1 do
if not isStringDisabled(str) then begin
str := rightList[i];
if isStringDisabled(str) then
continue;
if not FilenameIsAbsolute(str) then
str := c + str;
list.Add('-J'+ fSymStringExpander.expand(str)); list.Add('-J'+ fSymStringExpander.expand(str));
end;
// //
str := ''; str := '';
if fFname <> '' then if fFname <> '' then
@ -1154,7 +1203,11 @@ begin
else if baseopt.fFname <> '' then else if baseopt.fFname <> '' then
str := baseopt.fFname; str := baseopt.fFname;
if str.isNotEmpty then if str.isNotEmpty then
begin
if not FilenameIsAbsolute(str) then
str := c + DirectorySeparator + str;
list.Add('-of' + fSymStringExpander.expand(str)); list.Add('-of' + fSymStringExpander.expand(str));
end;
// //
str := ''; str := '';
if fObjDir <> '' then if fObjDir <> '' then
@ -1162,9 +1215,13 @@ begin
else if baseopt.fObjDir <> '' then else if baseopt.fObjDir <> '' then
str := baseopt.fObjDir; str := baseopt.fObjDir;
if str.isNotEmpty then if str.isNotEmpty then
begin
if not FilenameIsAbsolute(str) then
str := c + DirectorySeparator + str;
list.Add('-od' + fSymStringExpander.expand(str)); list.Add('-od' + fSymStringExpander.expand(str));
end; end;
end; end;
end;
procedure TPathsOpts.assign(source: TPersistent); procedure TPathsOpts.assign(source: TPersistent);
var var