-
Notifications
You must be signed in to change notification settings - Fork 6
/
lakefile.lean
52 lines (40 loc) · 1.45 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
import Lake
open Lake DSL
package «sampcert» where
-- add any package configuration options here
require mathlib from git
"https://github.com/leanprover-community/mathlib4.git" @ "v4.10.0"
@[default_target]
lean_lib «SampCert» where
extraDepTargets := #[`libleanffi,`libleanffidyn]
lean_lib «FastExtract» where
lean_lib «VMC» where
-- From doc-gen4
meta if get_config? env = some "doc" then
require «doc-gen4» from git "https://github.com/leanprover/doc-gen4" @ "main"
target ffi.o pkg : FilePath := do
let oFile := pkg.buildDir / "ffi.o"
let srcJob ← inputTextFile <| pkg.dir / "ffi.cpp"
let weakArgs := #["-I", (← getLeanIncludeDir).toString]
buildO oFile srcJob weakArgs #["-fPIC"] "g++" getLeanTrace
target libleanffi pkg : FilePath := do
let ffiO ← ffi.o.fetch
let name := nameToStaticLib "leanffi"
buildStaticLib (pkg.nativeLibDir / name) #[ffiO]
target libleanffidyn pkg : FilePath := do
let ffiO ← ffi.o.fetch
let name := nameToSharedLib "leanffi"
buildLeanSharedLib (pkg.nativeLibDir / name) #[ffiO]
lean_exe test where
root := `Test
extraDepTargets := #[`libleanffi]
moreLinkArgs := #["-L.lake/build/lib", "-lleanffi"]
lean_exe check where
root := `SampCertCheck
extraDepTargets := #[`libleanffi]
moreLinkArgs := #["-L.lake/build/lib", "-lleanffi"]
lean_exe mk_all where
root := `mk_all
supportInterpreter := true
-- Executables which import `Lake` must set `-lLake`.
weakLinkArgs := #["-lLake"]