-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.wren
52 lines (37 loc) · 899 Bytes
/
build.wren
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
// C compilation
var cc = CC.new()
cc.add_opt("-isystem=/usr/local/include")
cc.add_opt("-Isrc")
cc.add_opt("-fPIC")
cc.add_opt("-std=c99")
cc.add_opt("-Wall")
cc.add_opt("-Wextra")
cc.add_opt("-Werror")
var src = File.list("src")
.where { |path| path.endsWith(".c") }
src
.each { |path| cc.compile(path) }
// create static & dynamic libraries
var linker = Linker.new()
linker.archive(src.toList, "libumber.a")
linker.link(src.toList, [], "libumber.so", true)
// copy over headers
File.list("src")
.where { |path| path.endsWith(".h") }
.each { |path| Resources.install(path) }
// installation map
var install = {
"libumber.a": "lib/libumber.a",
"libumber.so": "lib/libumber.so",
"umber.h": "include/umber.h",
}
// testing
class Tests {
static filter {
return File.exec("test.sh")
}
static levels {
return File.exec("test.sh")
}
}
var tests = ["filter", "levels"]