[asdf-devel] Advanced Configuration

Faré fahree at gmail.com
Sat Nov 16 22:28:03 UTC 2013


On Sat, Nov 16, 2013 at 5:21 PM, FAU <fau at riseup.net> wrote:
> Ok so I've come up with something which seems to work.  Please have a
> look at this.  Is this a viable solution?
>
> Again here's the foo.lisp file:
>
> ;;; foo.lisp
> (defpackage :foo
>   (:use :cl)
>   (:export :foo))
>
> (in-package :foo)
>
> (defun foo ()
>   #+foo1.0
>   :foo1.0
>   #+foo1.1
>   :foo1.1
>   )
> ;;; foo.lisp ends here
>
> Here's the corresponding foo.asd file:
>
> ;;; foo.asd
> (defpackage :foo.system
>   (:use :cl :asdf :uiop))
>
> (in-package :foo.system)
>
> (defclass foo-file (cl-source-file)
>   ())
>
> (defmethod output-files ((operation compile-op) (component foo-file))
>   (let ((l (multiple-value-list (call-next-method))))
>     (apply #'values (mapcar #'(lambda (p)
>                                 (make-pathname* :directory (append (pathname-directory p) (list #
> +foo1.0 "1.0" #+foo1.1 "1.1")) :defaults p))
>                             (car l))
>            (cdr l))))
>
> (defsystem :foo
>   :serial t
>   :components ((:foo-file "foo")))
> ;;; foo.asd ends here
>
> In output-files we splice in a directory right before the file name
> depending on what is found in *features* (foo1.0 or foo1.1).  By this we
> seem to be able to keep a cached version for each.
>
> Any comment is appreciated.
>
You



More information about the asdf-devel mailing list