Coverage report: /home/ellis/comp/core/lib/cli/tools/cc.lisp
Kind | Covered | All | % |
expression | 0 | 113 | 0.0 |
branch | 0 | 10 | 0.0 |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; cli/tools/cc.lisp --- C Compilers
3
;; Use C* Compiler tooling from Lisp.
10
(in-package :cli/tools/cc)
12
(define-cli-tool :cc (&rest args)
13
(let ((proc (sb-ext:run-program *cc* args :wait t :output t)))
14
(unless (eq 0 (sb-ext:process-exit-code proc))
15
(cc-error "CC command failed: ~A ~A" *cc* (or args "")))))
17
(deferror ld-error (simple-error) () (:auto t))
21
#+unix (find-exe "ld.lld")
22
#+darwin (find-exe "ld64.lld")
23
#+windows (find-exe "lld-link")
26
(when *ld* (pushnew :ld *cli-tools*))
28
(defun run-ld (&rest args)
29
(let ((proc (sb-ext:run-program *ld* (or args nil) :output :stream)))
30
(with-open-stream (s (sb-ext:process-output proc))
31
(loop for l = (read-line s nil nil)
34
(if (eq 0 (sb-ext:process-exit-code proc))
36
(ld-error "LD command failed: ~A ~A" *ld* (or args "")))))
39
(define-cli-tool :nvcc (&rest args)
40
(let ((proc (sb-ext:run-program *nvcc* (or args nil) :output t)))
41
(if (eq 0 (sb-ext:process-exit-code proc))
43
(nvcc-error "NVCC command failed: ~A ~@[~A~]" *nvcc* args))))
45
(define-cli-tool :gdb (args &key (output t) (wait t) input)
46
(let ((proc (sb-ext:run-program *gdb* (or args nil) :output output :wait wait :input input)))
47
(if (eq 0 (sb-ext:process-exit-code proc))
49
(gdb-error "GDB command failed: ~A ~@[~A~]" *gdb* args))))
51
(define-cli-tool :lldb (args &key (output t) (wait t) input)
52
(let ((proc (sb-ext:run-program *lldb* (or args nil) :output output :wait wait :input input)))
53
(if (eq 0 (sb-ext:process-exit-code proc))
55
(lldb-error "LLDB command failed: ~A ~@[~A~]" *lldb* args))))