hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 6d10b98b51a77588609429ea77fa5ca396ced0a9
parent 4a420506542ca37762ec564df8939a58aada5af9
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri,  2 Apr 2021 17:12:16 -0400

cmd/hare: only apply -D to the root namespace

This is a temporary workaround, a better solution would be to parse and
test the namespace of the defined constant.

Diffstat:
Mcmd/hare/schedule.ha | 15++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha @@ -149,10 +149,6 @@ fn sched_hare_object( ]), }); - for (let i = 0z; i < len(plan.context.defines); i += 1) { - append(harec.cmd, "-D", plan.context.defines[i]); - }; - let current = false; let output = if (len(namespace) != 0) { let version = hex::encodestr(ver.hash); @@ -191,7 +187,16 @@ fn sched_hare_object( os::mkdirs(path); append(harec.cmd, "-t", path::join(path, td)); path::join(path, name); - } else mkfile(plan, "o"); // TODO: Should exes go in the cache? + } else { + // XXX: This is probably kind of dumb + // It would be better to apply any defines which affect this + // namespace instead + for (let i = 0z; i < len(plan.context.defines); i += 1) { + append(harec.cmd, "-D", plan.context.defines[i]); + }; + + mkfile(plan, "o"); // TODO: Should exes go in the cache? + }; for (let i = 0z; i < len(ver.inputs); i += 1) { let path = ver.inputs[i].path;