ref: d457a0d8f9f7bc6e136200fc814354d15aadbd42
parent: 56251d257472a214910a0d0861cae5090bdd83d9
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Apr 29 19:38:59 EDT 2016
Fix uses of slput()
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -183,7 +183,7 @@
const addincludes = {b, targ
for (inc, lib, subtarg) in targ.libdeps
if !hasinc(targ.incpath, inc)
- targ.incpath = std.slput(targ.incpath, 0, inc)
+ std.slput(&targ.incpath, 0, inc)
;;
;;
}
@@ -419,7 +419,7 @@
var sep
if !config.Directlib
- -> std.slput(cmd, head, std.fmt("-l{}", lib))
+ -> std.slput(&cmd, head, std.fmt("-l{}", lib))
else
match findlib(lib, incs)
| `std.None:
@@ -431,7 +431,7 @@
;;
std.fatal("could not find library lib{}.a.\n", lib)
| `std.Some p:
- -> std.slput(cmd, head, p)
+ -> std.slput(&cmd, head, p)
;;
;;
}
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -37,7 +37,7 @@
continue
;;
if t.incpath.len == 0 || !std.sleq(t.incpath[0], ".")
- t.incpath = std.slput(t.incpath, 0, std.sldup("."))
+ std.slput(&t.incpath, 0, std.sldup("."))
;;
buildbin(b, t, false)
bincmd = std.sldup([std.strcat("./", t.name)][:])
@@ -114,7 +114,7 @@
}
const buildtests = {b, targ
- var tt, bin, tests
+ var tt, bin, tests, incpath
var cmd
tests = [][:]
@@ -124,6 +124,7 @@
| `std.None: /* nothing to do */
| `std.Some path:
bin = srcswapsuffix(path, "")
+ incpath = std.sldup(targ.incpath)
tt = [
.name = bin,
.dir = targ.dir,
@@ -130,7 +131,7 @@
.inputs = [path][:],
.install = false,
.libdeps = std.sldup(targ.libdeps),
- .incpath = std.slput(std.sldup(targ.incpath), 0, "."),
+ .incpath = std.slput(&incpath, 0, "."),
]
buildbin(b, &tt, true)