Skip to content

Commit

Permalink
battery: Support C files in libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Wallbraker committed Nov 26, 2017
1 parent 55dca29 commit 5a0f9a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/battery/frontend/parameters.volt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ fn getArgsProject(b: Project, tag: string) string[]

ret ~= ["--src-I", fullPath(b.srcDir)];

ret ~= b.srcC;
ret ~= b.srcObj;
ret ~= b.srcAsm;

return ret;
Expand All @@ -209,9 +211,6 @@ fn getArgsLib(l: Lib) string[]
fn getArgsExe(e: Exe) string[]
{
ret := getArgsProject(e, "exe");

ret ~= e.srcC;
ret ~= e.srcObj;
ret ~= e.srcVolt;

if (e.bin !is null) {
Expand Down Expand Up @@ -388,6 +387,8 @@ protected:
case ArgCC: lib.xcc ~= arg.extra; break;
case ArgLink: lib.xlink ~= arg.extra; break;
case ArgLinker: lib.xlinker ~= arg.extra; break;
case FileC: lib.srcC ~= arg.extra; break;
case FileObj: lib.srcObj ~= arg.extra; break;
case FileAsm: lib.srcAsm ~= arg.extra; break;
case Command: handleCommand(c, arg.extra); break;
default:
Expand Down
4 changes: 1 addition & 3 deletions src/battery/frontend/scanner.volt
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public:
fn buildExe() Exe
{
exe := new Exe();
exe.srcC = filesC;
exe.bin = pathDerivedBin;

if (hasMainD) {
Expand All @@ -245,8 +244,6 @@ public:
fn buildLib() Lib
{
lib := new Lib();
lib.name = name;
lib.srcDir = pathSrc;

buildCommon(lib);

Expand All @@ -256,6 +253,7 @@ public:
fn buildCommon(p: Project)
{
p.name = name;
p.srcC = filesC;
p.srcDir = pathSrc;
p.batteryToml = pathBatteryToml;

Expand Down

0 comments on commit 5a0f9a4

Please sign in to comment.