1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 00:10:27 +00:00

Update cook to take headers for natives.

This should help incremental building.
This commit is contained in:
Calvin Rose 2019-06-13 00:41:20 -04:00
parent 5689ef1af1
commit 82edc19137
2 changed files with 6 additions and 1 deletions

View File

@ -248,7 +248,8 @@
(def cc (opt opts :compiler COMPILER))
(def cflags (getcflags opts))
(def defines (interpose " " (make-defines (opt opts :defines {}))))
(rule dest [src]
(def headers (or (opts :headers) []))
(rule dest [src ;headers]
(print "compiling " dest "...")
(if is-win
(shell cc ;defines "/c" ;cflags (string "/Fo" dest) src)

View File

@ -262,8 +262,12 @@ uint64_t janet_getflags(const Janet *argv, int32_t n, const char *flags) {
for (int32_t i = 0; i < flen; i++) {
if (((uint8_t) flags[i]) == keyw[j]) {
ret |= 1ULL << i;
goto found;
}
}
janet_panicf("unexpected flag %c, expected one of \"%s\"", (char) keyw[j], flags);
found:
;
}
return ret;
}