forked from commonqt/commonqt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qt.asd
90 lines (72 loc) · 2.83 KB
/
qt.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(defpackage :qt-system
(:use :cl :asdf))
(in-package :qt-system)
;;; .cpp
(defclass cpp->so (source-file)
())
(defmethod source-file-type ((c cpp->so) (s module)) "cpp")
(defmethod output-files ((operation compile-op) (c cpp->so))
(values
(loop for filename in '("libcommonqt.so" "libcommonqt.so.1"
"libcommonqt.so.1.0" "libcommonqt.so.1.0.0")
collect (merge-pathnames filename (component-pathname c)))
;; libcommonqt.so* files are never moved to separate FASL directory
t))
(defmethod perform ((o load-op) (c cpp->so))
t)
(defmethod perform ((o compile-op) (c cpp->so))
(unless (operation-done-p o c)
(when (find-package :qt)
(set (find-symbol "*LOADED*" :qt) nil))
(unless (zerop (run-shell-command
"if which gmake; then gmake -C ~S; else make -C ~:*~S; fi"
(namestring
(make-pathname :name nil
:type nil
:defaults (component-pathname c)))))
(error 'operation-error :component c :operation o))))
;;; qmake
(defclass makefile (source-file)
())
(defmethod source-file-type ((c makefile) (s module)) nil)
;; we use :AROUND here as there's often another :AROUND method on ASDF:OUTPUT-FILES
;; that places the output into some FASL directory
(defmethod output-files :around ((operation compile-op) (c makefile))
(list (make-pathname :name "Makefile"
:type nil
:defaults (component-pathname c))))
(defmethod perform ((o load-op) (c makefile))
t)
(defmethod perform ((o compile-op) (c makefile))
(unless (operation-done-p o c)
(when (find-package :qt)
(set (find-symbol "*LOADED*" :qt) nil))
(unless (zerop (run-shell-command
"qmake ~S -o ~S"
(namestring
(merge-pathnames "commonqt.pro" (component-pathname c)))
(namestring (output-file o c))))
(error 'operation-error :component c :operation o))))
;;; system
(defsystem :qt
:serial t
:components (#-(or mswindows windows win32) (makefile "commonqt.pro")
#-(or mswindows windows win32) (cpp->so "commonqt")
(:file "package")
(:file "utils")
(:file "ffi")
(:file "reader")
(:file "marshal")
(:file "unmarshal")
(:file "classess")
(:file "primitive-call")
(:file "info")
(:file "call")
(:file "qvariant")
(:file "meta")
(:file "property")
(:file "qlist")
(:file "qapp")
(:file "connect"))
:depends-on (:cffi :named-readtables :cl-ppcre :alexandria :closer-mop
:iterate :trivial-garbage))