use symbols for unique-key; tell conspack to intern them

This commit is contained in:
Moonchild 2020-10-04 17:26:35 -07:00
parent 28c5385531
commit a1945220d2
2 changed files with 4 additions and 5 deletions

@ -65,7 +65,7 @@
(setf (slot-value b 'input-files) (slot-value b 'obj-files))
(setf (slot-value b 'output-files) (list (slot-value b 'target-binary)))
(setf (slot-value b 'pretty-name) (slot-value b 'target-binary))
(setf (slot-value b 'unique-key) (cons "c-binary-buildable" (cons (slot-value b 'target-binary) (slot-value b 'obj-files)))))
(setf (slot-value b 'unique-key) (cons 'c-binary-buildable (cons (slot-value b 'target-binary) (slot-value b 'obj-files)))))
(defmethod do-build ((b c-binary-buildable))
(runp (format nil "cc -o ~a ~{~a~^ ~}" (slot-value b 'target-binary) (slot-value b 'obj-files))))
@ -74,9 +74,7 @@
(setf (slot-value b 'input-files) (list (slot-value b 'source-file)))
(setf (slot-value b 'output-files) (list (slot-value b 'obj-file)))
(setf (slot-value b 'pretty-name) (slot-value b 'source-file))
; conspack doesn't automatically intern symbols so we have to use "c-source-buildable" instead of 'c-source-buildable
; (because uninterned symbols aren't equal to anything)
(setf (slot-value b 'unique-key) (list "c-source-buildable" (slot-value b 'obj-file) (slot-value b 'source-file))))
(setf (slot-value b 'unique-key) (list 'c-source-buildable (slot-value b 'obj-file) (slot-value b 'source-file))))
(defmethod do-build ((b c-source-buildable))
(ensure-directories-exist (directory-namestring (slot-value b 'obj-file)))

@ -20,7 +20,8 @@
:element-type '(unsigned-byte 8))
(let ((buf (make-array (file-length fp) :element-type '(unsigned-byte 8))))
(read-sequence buf fp)
(setf *global-cache* (conspack:decode buf)))))
(setf *global-cache*
(conspack:with-interning () (conspack:decode buf))))))
(load "fancy.build")