pegrep-cl/pegrep.asd
2024-09-22 16:31:14 -05:00

67 lines
2 KiB
Common Lisp

(require 'asdf)
#+sb-core-compression
(defmethod asdf:perform ((o asdf:image-op) (c asdf:system))
(uiop:dump-image (asdf:output-file o c)
:executable t
:compression t))
(defmacro def-pegrep (name &rest args)
`(asdf:defsystem ,name
:serial t
:build-operation "program-op"
:entry-point "pegrep:entry"
:depends-on (:alexandria :clingon)
:components
((:module "./src"
:serial t
:components ((:file "pegrep"))))
,@args))
(def-pegrep :pegrep
:build-pathname "./build/pegrep"
:around-compile (lambda (next)
(proclaim '(optimize
(safety 3)
(debug 0)
(speed 3)))
(funcall next)))
(def-pegrep :pegrep/faf
:build-pathname "./build/pegrep-faf"
:around-compile (lambda (next)
(proclaim '(optimize
(safety 0)
(debug 0)
(speed 3)))
(funcall next)))
(def-pegrep :pegrep/debug
:build-pathname "./build/pegrep-debug"
:around-compile (lambda (next)
(proclaim '(optimize
(safety 3)
(debug 3)
(speed 0)))
(funcall next)))
;; For later I suppose, use deploy to build
(asdf:defsystem :pegrep/deploy
:serial t
:defsystem-depends-on (:deploy)
:build-pathname "pegrep-deploy"
:build-operation "deploy-op"
:entry-point "pegrep:entry"
:depends-on (:alexandria :clingon)
:components
((:module "./src"
:serial t
:components ((:file "pegrep")))))
(asdf:defsystem :pegrep/tests
:depends-on (:pegrep :fiveam)
:perform (asdf:test-op (o s)
(uiop:symbol-call :pegrep-tests :test-pegrep))
:components ((:module "./test"
:serial t
:components ((:file "main")))))