mirror of https://gitlab.com/basile.b/dexed.git
implemented base/overridden config, close #37
This commit is contained in:
parent
347b23caf4
commit
706c3ff3d5
|
@ -651,13 +651,10 @@ begin
|
||||||
if baseopt.fAllInst or fAllInst then aList.Add('-allinst');
|
if baseopt.fAllInst or fAllInst then aList.Add('-allinst');
|
||||||
if baseopt.fAddMain or fAddMain then aList.Add('-main');
|
if baseopt.fAddMain or fAddMain then aList.Add('-main');
|
||||||
if baseopt.fRelease or fRelease then aList.Add('-release');
|
if baseopt.fRelease or fRelease then aList.Add('-release');
|
||||||
if (fVerIds.Count > 0) then
|
if (fVerIds.Count = 0) then for str in baseopt.fVerIds do begin
|
||||||
for str in fVerIds do begin
|
|
||||||
if not isStringDisabled(str) then aList.Add('-version=' + str);
|
if not isStringDisabled(str) then aList.Add('-version=' + str);
|
||||||
end
|
end else for str in fVerIds do
|
||||||
else for str in baseopt.fVerIds do begin
|
|
||||||
if not isStringDisabled(str) then aList.Add('-version=' + str);
|
if not isStringDisabled(str) then aList.Add('-version=' + str);
|
||||||
end;
|
|
||||||
// default values are not handled here, TODO
|
// default values are not handled here, TODO
|
||||||
if fBoundsCheck <> baseopt.fBoundsCheck then
|
if fBoundsCheck <> baseopt.fBoundsCheck then
|
||||||
aList.Add('-boundscheck=' + bchKindStr[fBoundsCheck] )
|
aList.Add('-boundscheck=' + bchKindStr[fBoundsCheck] )
|
||||||
|
@ -796,7 +793,7 @@ end;
|
||||||
|
|
||||||
procedure TDebugOpts.getOpts(aList: TStrings; base: TOptsGroup = nil);
|
procedure TDebugOpts.getOpts(aList: TStrings; base: TOptsGroup = nil);
|
||||||
var
|
var
|
||||||
idt, idtbase: string;
|
idt: string;
|
||||||
baseopt: TDebugOpts;
|
baseopt: TDebugOpts;
|
||||||
begin
|
begin
|
||||||
if base = nil then
|
if base = nil then
|
||||||
|
@ -817,6 +814,9 @@ begin
|
||||||
aList.Add('-debug=' + intToStr(baseopt.fDbgLevel))
|
aList.Add('-debug=' + intToStr(baseopt.fDbgLevel))
|
||||||
else if fDbgLevel <> 0 then
|
else if fDbgLevel <> 0 then
|
||||||
aList.Add('-debug=' + intToStr(fDbgLevel));
|
aList.Add('-debug=' + intToStr(fDbgLevel));
|
||||||
|
if fDbgIdents.Count = 0 then
|
||||||
|
for idt in baseopt.fDbgIdents do aList.Add('-debug=' + idt)
|
||||||
|
else for idt in fDbgIdents do aList.Add('-debug=' + idt);
|
||||||
if baseopt.fDbgD or fDbgD then aList.Add('-g');
|
if baseopt.fDbgD or fDbgD then aList.Add('-g');
|
||||||
if baseopt.fDbgC or fDbgC then aList.Add('-gc');
|
if baseopt.fDbgC or fDbgC then aList.Add('-gc');
|
||||||
if baseopt.fGenMap or fGenMap then aList.Add('-map');
|
if baseopt.fGenMap or fGenMap then aList.Add('-map');
|
||||||
|
@ -924,6 +924,7 @@ var
|
||||||
str: string;
|
str: string;
|
||||||
exts: TStringList;
|
exts: TStringList;
|
||||||
baseopt: TPathsOpts;
|
baseopt: TPathsOpts;
|
||||||
|
rightList: TStringList;
|
||||||
begin
|
begin
|
||||||
if base = nil then
|
if base = nil then
|
||||||
begin
|
begin
|
||||||
|
@ -951,7 +952,43 @@ begin
|
||||||
aList.Add('-od' + symbolExpander.get(fObjDir));
|
aList.Add('-od' + symbolExpander.get(fObjDir));
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
//TODO-cNativeProjects: get paths options if base config is specified.
|
baseopt := TPathsOpts(base);
|
||||||
|
if fExtraSrcs.Count = 0 then rightList := baseopt.fExtraSrcs
|
||||||
|
else rightList := fExtraSrcs;
|
||||||
|
exts := TStringList.Create;
|
||||||
|
try
|
||||||
|
exts.AddStrings(['.d', '.di', '.dd']);
|
||||||
|
for str in rightList do
|
||||||
|
begin
|
||||||
|
if isStringDisabled(str) then
|
||||||
|
continue;
|
||||||
|
str := symbolExpander.get(str);
|
||||||
|
if not listAsteriskPath(str, aList, exts) then
|
||||||
|
aList.Add(str);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
exts.Free;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
if fImpMod.Count = 0 then rightList := baseopt.fImpMod
|
||||||
|
else rightList := fImpMod;
|
||||||
|
for str in rightList do if not isStringDisabled(str) then
|
||||||
|
aList.Add('-I'+ symbolExpander.get(str));
|
||||||
|
//
|
||||||
|
if fImpStr.Count = 0 then rightList := baseopt.fImpStr
|
||||||
|
else rightList := fImpStr;
|
||||||
|
for str in rightList do if not isStringDisabled(str) then
|
||||||
|
aList.Add('-J'+ symbolExpander.get(str));
|
||||||
|
//
|
||||||
|
str := '';
|
||||||
|
if fFname <> '' then str := fFname else
|
||||||
|
if baseopt.fFname <> '' then str := baseopt.fFname;
|
||||||
|
if str <> '' then aList.Add('-of' + symbolExpander.get(str));
|
||||||
|
//
|
||||||
|
str := '';
|
||||||
|
if fObjDir <> '' then str := fObjDir else
|
||||||
|
if baseopt.fObjDir <> '' then str := baseopt.fObjDir;
|
||||||
|
if str <> '' then aList.Add('-od' + symbolExpander.get(str));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1054,6 +1091,7 @@ procedure TOtherOpts.getOpts(aList: TStrings; base: TOptsGroup = nil);
|
||||||
var
|
var
|
||||||
str1, str2: string;
|
str1, str2: string;
|
||||||
baseopt: TOtherOpts;
|
baseopt: TOtherOpts;
|
||||||
|
rightList: TStringList;
|
||||||
begin
|
begin
|
||||||
if base = nil then
|
if base = nil then
|
||||||
begin
|
begin
|
||||||
|
@ -1070,19 +1108,9 @@ begin
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
baseopt := TOtherOpts(base);
|
baseopt := TOtherOpts(base);
|
||||||
if fCustom.Count > 0 then
|
if fCustom.Count = 0 then rightList := baseopt.fCustom
|
||||||
begin
|
else rightList := fCustom;
|
||||||
for str1 in fCustom do if str1 <> '' then
|
for str1 in rightList do if str1 <> '' then
|
||||||
begin
|
|
||||||
if isStringDisabled(str1) then
|
|
||||||
continue;
|
|
||||||
if str1[1] <> '-' then
|
|
||||||
str2 := '-' + str1
|
|
||||||
else
|
|
||||||
str2 := str1;
|
|
||||||
aList.AddText(symbolExpander.get(str2));
|
|
||||||
end;
|
|
||||||
end else for str1 in baseopt.fCustom do if str1 <> '' then
|
|
||||||
begin
|
begin
|
||||||
if isStringDisabled(str1) then
|
if isStringDisabled(str1) then
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -251,10 +251,13 @@ begin
|
||||||
for i:= 0 to fConfigs.Count-1 do
|
for i:= 0 to fConfigs.Count-1 do
|
||||||
if configuration[i].isBaseConfiguration then
|
if configuration[i].isBaseConfiguration then
|
||||||
fBaseConfig := configuration[i];
|
fBaseConfig := configuration[i];
|
||||||
|
// silently disables any other config. set as base without calling doChange
|
||||||
|
Inc(fUpdateCount);
|
||||||
for i := 0 to fConfigs.Count-1 do
|
for i := 0 to fConfigs.Count-1 do
|
||||||
if configuration[i].isBaseConfiguration then
|
if configuration[i].isBaseConfiguration then
|
||||||
if configuration[i] <> fBaseConfig then
|
if configuration[i] <> fBaseConfig then
|
||||||
configuration[i].isBaseConfiguration := false;
|
configuration[i].isBaseConfiguration := false;
|
||||||
|
Dec(fUpdateCount);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCENativeProject.subMemberChanged(sender : TObject);
|
procedure TCENativeProject.subMemberChanged(sender : TObject);
|
||||||
|
|
Loading…
Reference in New Issue