/
ssrunfile.scm
50 lines (45 loc) · 1.72 KB
/
ssrunfile.scm
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
(include "~~lib/ssrun/tasks/core.scm")
(define libraries
`(((spheres/cairo cairo)
.
,(lambda (lib)
(if (eq? 'osx (ssrun#host-platform))
(begin
;; This fixes and issue in OSX when Cairo is installed with Homebrew
(setenv "PKG_CONFIG_PATH" "/opt/X11/lib/pkgconfig/")
(let ((cc-options
(string-append
(with-input-from-process
(list path: "pkg-config"
arguments: '("--cflags" "cairo")) read-line)
"-w"))
(ld-options
(with-input-from-process
(list path: "pkg-config"
arguments: '("--libs" "cairo"))
read-line)))
(ssrun#compile-library
lib
cond-expand-features: '(debug)
cc-options: cc-options
ld-options: ld-options)))
(ssrun#compile-library
lib
cond-expand-features: '(debug)
cc-options: "-w"
ld-options: ""))))))
(define-task (compile library) ()
;; This fixes and issue in OSX: pkg-config not finding GL
;; (if (eq? (sake#host-platform) 'osx)
;; (setenv "PKG_CONFIG_PATH" "/opt/X11/lib/pkgconfig/"))
(if library
(let ((entry (assoc library libraries))) ((cdr entry) (car entry)))
(for-each (lambda (entry) ((cdr entry) (car entry))) libraries)))
(define-task (test file) ()
(if file
(ssrun#run-file (string-append "test/" file))
(ssrun#run-all-files "test/")))
(define-task clean ()
(ssrun#clean-libraries (map car libraries)))
(define-task all (compile)
(void))