(zilch ninja): resolve depfile and source overrides relative to zilch file

Change-Id: I6a6a6964b712289cfd408a02f3b6951e1de53e97
This commit is contained in:
puck 2025-09-29 15:20:29 +00:00
parent 0023f3def8
commit 3a6e716a5e
2 changed files with 26 additions and 17 deletions

View file

@ -53,7 +53,7 @@
(define source (and (assoc 'source options) (cdr (assoc 'source options))))
(define config-path (if (assoc 'config-file options) (cdr (assoc 'config-file options)) "zilch.scm"))
(define config (parse-ninja-config `(override-source: ,source ,@(call-with-input-file config-path read))))
(define config (parse-ninja-config config-path `(override-source: ,(and source (vfs-from-directory source)) ,@(call-with-input-file config-path read))))
(when (and (ninja-build-config-depfile-path config) (file-exists? (ninja-build-config-depfile-path config)))
(set-ninja-build-config-depfile! config (alist->mapping (make-default-comparator) (call-with-input-file (ninja-build-config-depfile-path config) read))))