-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathProject.carp
25 lines (20 loc) · 1.02 KB
/
Project.carp
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
(defndynamic project-config [bindings]
(if (< (length bindings) 2)
(list)
(cons-last (project-config (cdr (cdr bindings))) (list 'do (list 'Project.config
(car bindings) (car (cdr bindings)))))))
(doc defproject "Define a project configuration.")
(defmacro defproject [:rest bindings]
(project-config bindings))
(doc save-docs "A simple version of `save-docs-ex` that lets you list all the modules directly as unquoted symbols. Does not handle global symbols, use `save-docs-ex` for that.
Example usage: `(save-docs Int Float String)`")
(defmacro save-docs [:rest modules]
(eval (list 'save-docs-ex (list quote (collect-into modules array)) [])))
(defmodule Project
(hidden append-flag)
(defndynamic append-flag [flag-set flag]
(Project.config flag-set (cons flag (Project.get-config flag-set))))
(defmacro append-cflag [flag] (Project.append-flag "cflag" flag))
(defmacro append-libflag [flag] (Project.append-flag "libflag" flag))
(defmacro append-pkgflag [flag] (Project.append-flag "pkgconfigflag" flag))
)