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