-
Notifications
You must be signed in to change notification settings - Fork 2
/
cl-treesitter.asd
37 lines (32 loc) · 1.38 KB
/
cl-treesitter.asd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(or
(when (find-package '#:OCICL-RUNTIME)
(progv (list (find-symbol "*DOWNLOAD*" '#:OCICL-RUNTIME)
(find-symbol "*VERBOSE*" '#:OCICL-RUNTIME))
(list t t)
(funcall (find-symbol "LOAD-SYSTEM" '#:asdf) :cffi-toolchain)))
(when (find-package '#:QUICKLISP)
(funcall (find-symbol "QUICKLOAD" '#:QUICKLISP) :cffi-toolchain))
(when (find-package '#:ASDF)
(funcall (find-symbol "LOAD-SYSTEM" '#:ASDF) :cffi-toolchain))
(error "Unable to find any system-loading mechanism."))
(defclass c-source-file (asdf:source-file) ())
(defmethod asdf:perform ((op asdf:load-op) (obj c-source-file)) t)
(defmethod asdf:perform ((op asdf:compile-op) (obj c-source-file))
(with-slots ((name asdf/component:absolute-pathname)) obj
(cffi-toolchain:link-shared-library
(format nil "~a.so" name)
(list (format nil "~a.c" name)))))
(asdf:defsystem #:cl-treesitter
:author "garlic0x1"
:license "MIT"
:description "libtree-sitter bindings for Common Lisp"
:depends-on (:cffi :trivial-garbage)
:components ((:c-source-file "shim")
(:file "bindings")
(:file "treesitter")))
(asdf:defsystem #:cl-treesitter/test
:description "Tests for cl-treesitter"
:depends-on (:alexandria :fiveam :cl-treesitter)
:components ((:module "t"
:components ((:file "test-bindings")
(:file "test-treesitter")))))