(zilch lang ninja): support include
Change-Id: I6a6a69643a4a1d2b96386851a26d13237737f645
This commit is contained in:
parent
a6757baf0e
commit
48692fc50d
2 changed files with 24 additions and 13 deletions
|
|
@ -101,10 +101,13 @@
|
|||
|
||||
(set-ninja-build-config-root-dir! conf configured-vfs)
|
||||
|
||||
(define (read-file-at-path path)
|
||||
(set! path (string-append "build/" path))
|
||||
(define last-slash (string-contains-right path "/"))
|
||||
(call-with-port (store-path-open (vfs-file-ref configured-vfs (string-copy path 0 last-slash) (string-copy path (+ 1 last-slash))))
|
||||
(lambda (p) (read-bytevector (* 20 1024 1024) p))))
|
||||
(define ninja-file
|
||||
(read-ninja-file
|
||||
(call-with-port (store-path-open (vfs-file-ref configured-vfs "build" "build.ninja"))
|
||||
(lambda (p) (read-bytevector (* 20 1024 1024) p)))))
|
||||
(read-ninja-file (read-file-at-path "build.ninja") read-file-at-path))
|
||||
|
||||
; Process the build.ninja file.
|
||||
(define-values (edge-ref defaults) (process-ninja-file ninja-file conf "build"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue