lean4-htt/Lake/Config/LeanExeConfig.lean

50 lines
1.3 KiB
Text

/-
Copyright (c) 2022 Mac Malone. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mac Malone
-/
namespace Lake
open Lean System
/-- A Lean executable's declarative configuration. -/
structure LeanExeConfig where
/-- The name of the target. -/
name : Name
/--
The root module of the binary executable.
Should include a `main` definition that will serve
as the entry point of the program.
The root is built by recursively building its
local imports (i.e., fellow modules of the workspace).
Defaults to the name of the target.
-/
root : Name := name
/--
The name of the binary executable.
Defaults to the target name with any `.` replaced with a `-`.
-/
exeName : String := name.toStringWithSep "-" (escape := false)
/--
Whether to expose symbols within the executable to the Lean interpreter.
This allows the executable to interpret Lean files (e.g., via
`Lean.Elab.runFrontend`).
Implementation-wise, this passes `-rdynamic` to the linker when building
on non-Windows systems.
Defaults to `false`.
-/
supportInterpreter : Bool := false
/--
Additional arguments to pass to `leanc` when linking the binary executable.
These will come *after* the paths of the package's external libraries.
-/
moreLinkArgs : Array String := #[]
deriving Inhabited, Repr