more for #10, handle mainSourceFile

This commit is contained in:
Basile Burg 2015-09-17 21:13:47 +02:00
parent c95c8ff54b
commit 782f5ff59c
1 changed files with 12 additions and 2 deletions

View File

@ -419,7 +419,10 @@ begin
fSrcs.Clear; fSrcs.Clear;
lst := TStringList.Create; lst := TStringList.Create;
try try
// auto folders // auto folders & files
item := fJSON.Find('mainSourceFile');
if item <> nil then
fSrcs.Add(ExtractRelativepath(fBasePath, item.AsString));
tryAddFromFolder(fBasePath + 'src'); tryAddFromFolder(fBasePath + 'src');
tryAddFromFolder(fBasePath + 'source'); tryAddFromFolder(fBasePath + 'source');
// custom folders // custom folders
@ -444,6 +447,9 @@ begin
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if conf <> nil then if conf <> nil then
begin begin
item := conf.Find('mainSourceFile');
if item <> nil then
fSrcs.Add(ExtractRelativepath(fBasePath, item.AsString));
// custom folders in current config // custom folders in current config
item := conf.Find('sourcePaths'); item := conf.Find('sourcePaths');
if item <> nil then if item <> nil then
@ -467,7 +473,6 @@ begin
// //
deleteDups(fSrcs); deleteDups(fSrcs);
// TODO-cDUB: manage exclusions from 'excludedSourceFiles' (global + curr conf) // TODO-cDUB: manage exclusions from 'excludedSourceFiles' (global + curr conf)
// + mainSourceFile.
finally finally
lst.Free; lst.Free;
end; end;
@ -478,6 +483,11 @@ var
tt: TJSONData; tt: TJSONData;
begin begin
result := true; result := true;
if value.Find('mainSourceFile') <> nil then
begin
fBinKind := executable;
exit;
end;
tt := value.Find('targetType'); tt := value.Find('targetType');
if tt <> nil then if tt <> nil then
begin begin