Lake equivalent of CMake's
CMAKE_BUILD_TYPE
.
- debug: Lake.BuildType
Debug optimization, asserts enabled, custom debug code enabled, and debug info included in executable (so you can step through the code with a debugger and have address to source-file:line-number translation). For example, passes
-Og -g
when compiling C code. - relWithDebInfo: Lake.BuildType
Optimized, with debug info, but no debug code or asserts (e.g., passes
-O3 -g -DNDEBUG
when compiling C code). - minSizeRel: Lake.BuildType
Same as
release
but optimizing for size rather than speed (e.g., passes-Os -DNDEBUG
when compiling C code). - release: Lake.BuildType
High optimization level and no debug info, code, or asserts (e.g., passes
-O3 -DNDEBUG
when compiling C code).
Instances For
Equations
- Lake.instReprBuildType = { reprPrec := Lake.reprBuildType✝ }
Equations
- Lake.instOrdBuildType = { compare := Lake.ordBuildType✝ }
Ordering on build types. The ordering is used to determine the minimum build version that is necessary for a build.
Compiler backend with which to compile Lean.
- c: Lake.Backend
Force the C backend.
- llvm: Lake.Backend
Force the LLVM backend.
- default: Lake.Backend
Use the default backend. Can be overridden by more specific configuration.
Instances For
Equations
- Lake.instDecidableEqBackend x y = if h : x.toCtorIdx = y.toCtorIdx then isTrue ⋯ else isFalse ⋯
Equations
- Lake.instInhabitedBackend = { default := Lake.Backend.default }
Equations
Instances For
If the left backend is default, choose the right one.
Otherwise, keep the left one.
This is used to implement preferential choice of backends,
where the library config can refine the package config.
Formally, a left absorbing monoid on {C
, LLVM
} with Default
as the unit.
Equations
- Lake.Backend.default.orPreferLeft x = x
- x✝.orPreferLeft x = x✝
Instances For
The arguments to pass to leanc
based on the build type.
Equations
- Lake.BuildType.debug.leancArgs = #["-Og", "-g"]
- Lake.BuildType.relWithDebInfo.leancArgs = #["-O3", "-g", "-DNDEBUG"]
- Lake.BuildType.minSizeRel.leancArgs = #["-Os", "-DNDEBUG"]
- Lake.BuildType.release.leancArgs = #["-O3", "-DNDEBUG"]
Instances For
Equations
- Lake.BuildType.ofString? "debug" = some Lake.BuildType.debug
- Lake.BuildType.ofString? "relWithDebInfo" = some Lake.BuildType.relWithDebInfo
- Lake.BuildType.ofString? "minSizeRel" = some Lake.BuildType.minSizeRel
- Lake.BuildType.ofString? "release" = some Lake.BuildType.release
- Lake.BuildType.ofString? s = none
Instances For
Option that is used by Lean as if it was passed using -D
.
- name : Lean.Name
- value : Lean.LeanOptionValue
Instances For
Equations
- Lake.instReprLeanOption = { reprPrec := Lake.reprLeanOption✝ }
Configuration options common to targets that build modules.
- buildType : Lake.BuildType
- leanOptions : Array Lake.LeanOption
Additional options to pass to both the Lean language server (i.e.,
lean --server
) launched bylake serve
and tolean
when compiling a module's Lean source files. Additional arguments to pass to
lean
when compiling a module's Lean source files.Additional arguments to pass to
lean
when compiling a module's Lean source files.Unlike
moreLeanArgs
, these arguments do not affect the trace of the build result, so they can be changed without triggering a rebuild. They come beforemoreLeanArgs
.Additional arguments to pass to
leanc
when compiling a module's C source files generated bylean
.Lake already passes some flags based on the
buildType
, but you can change this by, for example, adding-O0
and-UNDEBUG
.- moreServerOptions : Array Lake.LeanOption
Additional options to pass to the Lean language server (i.e.,
lean --server
) launched bylake serve
. Additional arguments to pass to
leanc
when compiling a module's C source files generated bylean
.Unlike
moreLeancArgs
, these arguments do not affect the trace of the build result, so they can be changed without triggering a rebuild. They come beforemoreLeancArgs
.Additional arguments to pass to
leanc
when linking (e.g., for shared libraries or binary executables). These will come after the paths of external libraries.Additional arguments to pass to
leanc
when linking (e.g., for shared libraries or binary executables). These will come after the paths of external libraries.Unlike
moreLinkArgs
, these arguments do not affect the trace of the build result, so they can be changed without triggering a rebuild. They come beforemoreLinkArgs
.- backend : Lake.Backend
Compiler backend that modules should be built using (e.g.,
C
,LLVM
). Defaults toC
. Asserts whether Lake should assume Lean modules are platform-independent.
If
false
, Lake will addSystem.Platform.target
to the module traces within the code unit (e.g., package or library). This will force Lean code to be re-elaborated on different platforms.If
true
, Lake will exclude platform-dependent elements (e.g., precompiled modules, external libraries) from a module's trace, preventing re-elaboration on different platforms. Note that this will not effect modules outside the code unit in question. For example, a platform-independent package which depends on a platform-dependent library will still be platform-dependent.If
none
, Lake will construct traces as natural. That is, it will include platform-dependent artifacts in the trace if they module depends on them, but otherwise not force modules to be platform-dependent.
There is no check for correctness here, so a configuration can lie and Lake will not catch it. Defaults to
none
.
Instances For
Equations
- One or more equations did not get rendered due to their size.