-
Notifications
You must be signed in to change notification settings - Fork 0
/
lakefile.lean
58 lines (49 loc) · 1.83 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
53
54
55
56
57
58
import Lake
open Lake DSL
abbrev algorithmOnlyLinters : Array LeanOption := #[
⟨`linter.hashCommand, true⟩,
⟨`linter.oldObtain, true,⟩,
⟨`linter.refine, true⟩,
⟨`linter.style.cdot, true⟩,
⟨`linter.style.dollarSyntax, true⟩,
⟨`linter.style.header, true⟩,
⟨`linter.style.lambdaSyntax, true⟩,
⟨`linter.style.longLine, true⟩,
⟨`linter.style.longFile, .ofNat 1500⟩,
-- `latest_import.yml` uses this comment: if you edit it, make sure that the workflow still works
⟨`linter.style.missingEnd, true⟩,
⟨`linter.style.multiGoal, true⟩,
⟨`linter.style.setOption, true⟩
]
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
require "leanprover-community" / "mathlib" @ git "v4.15.0-rc1"
require "leanprover" / "doc-gen4" @ git "v4.15.0-rc1"
lean_lib Mutable where
roots := #[`Mutable]
precompileModules := true
@[default_target]
lean_lib Algorithm where
leanOptions := algorithmLeanOptions
-- Mathlib also enforces these linter options, which are not active by default.
moreServerOptions := algorithmOnlyLinters
moreLinkArgs := #[
"-L./.lake/build/lib",
"-lstdc++"
]
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.nativeLibDir / name) #[ffiO]
-- @[test_driver]
-- lean_exe test where
-- srcDir := "scripts"