-
Notifications
You must be signed in to change notification settings - Fork 0
/
lakefile.lean
39 lines (31 loc) · 950 Bytes
/
lakefile.lean
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
import Lake
open Lake DSL
package generate {
srcDir := "src"
moreLinkArgs := #["-lvulkan", "-lglfw"]
}
lean_lib Generate
lean_lib Vk
@[default_target]
lean_exe generate {
root := `Generate
}
@[default_target]
lean_exe demo {
root := `Demo
}
target vk.o pkg : FilePath := do
let oFile := pkg.buildDir / "c" / "vk.o"
let srcJob ← inputFile <| pkg.srcDir / "Vk" / "glue.c"
let flags := #["-I", (← getLeanIncludeDir).toString, "-fPIC"]
buildO "glue.c" oFile srcJob flags
target glfw.o pkg : FilePath := do
let oFile := pkg.buildDir / "c" / "glfw.o"
let srcJob ← inputFile <| pkg.srcDir / "Vk" / "glfw.c"
let flags := #["-I", (← getLeanIncludeDir).toString, "-fPIC"]
buildO "glfw.c" oFile srcJob flags
extern_lib vk_glue pkg := do
let name := nameToStaticLib "vk_glue"
let vkO ← fetch <| pkg.target ``vk.o
let glfwO ← fetch <| pkg.target ``glfw.o
buildStaticLib (pkg.nativeLibDir / name) #[vkO, glfwO]