-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlakefile.lean
More file actions
46 lines (36 loc) · 1.33 KB
/
lakefile.lean
File metadata and controls
46 lines (36 loc) · 1.33 KB
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
import Lake
open Lake DSL
require "leanprover-community" / "mathlib" @ git "v4.27.0-rc1"
abbrev algorithmOnlyLinters : Array LeanOption := #[
⟨`linter.mathlibStandardSet, true⟩,
⟨`linter.style.longFile, .ofNat 1500⟩,
-- `latest_import.yml` uses this comment: if you edit it, make sure that the workflow still works
]
abbrev algorithmLeanOptions := #[
⟨`pp.unicode.fun, true⟩, -- pretty-prints `fun a ↦ b`
⟨`autoImplicit, false⟩
] ++ -- options that are used in `lake build`
algorithmOnlyLinters.map fun s ↦ { s with name := `weak ++ s.name }
package algorithm where
testDriver := "AlgorithmTest"
lean_lib Mutable where
roots := #[`Mutable]
precompileModules := true
@[default_target]
lean_lib Algorithm where
leanOptions := algorithmLeanOptions
moreLinkArgs := #[
"-L./.lake/build/lib",
"-lstdc++"
]
lean_lib AlgorithmTest where
globs := #[.submodules `AlgorithmTest]
target ffi.o pkg : System.FilePath := do
let oFile := pkg.buildDir / "cpp" / "ffi.o"
let srcJob ← inputBinFile <| pkg.dir / "cpp" / "ffi.cpp"
let weakArgs := #["-I", (← getLeanIncludeDir).toString]
buildO oFile srcJob weakArgs #["-fPIC"] "clang++" getLeanTrace
extern_lib libleanffi pkg := do
let name := nameToStaticLib "leanffi"
let ffiO ← ffi.o.fetch
buildStaticLib (pkg.staticLibDir / name) #[ffiO]