feat: Output shared library in Nix flake #48

Merged
aniva merged 16 commits from feature/lib into dev 2024-03-16 19:01:04 -07:00
2 changed files with 7 additions and 2 deletions
Showing only changes of commit 4706df2217 - Show all commits

View File

@ -48,8 +48,7 @@ unsafe def main (args: List String): IO Unit := do
println! s!"{version}"
return
Lean.enableInitializersExecution
Lean.initSearchPath (← Lean.findSysroot)
initSearch ""
let coreContext ← args.filterMap (λ s => if s.startsWith "--" then .some <| s.drop 2 else .none)
|>.toArray |> createCoreContext

View File

@ -38,6 +38,12 @@ namespace Pantograph
@[export pantograph_version]
def pantographVersion: String := version
/-- Adds the given paths to Lean package search path -/
@[export pantograph_init_search]
unsafe def initSearch (sp: String): IO Unit := do
Lean.enableInitializersExecution
Lean.initSearchPath (← Lean.findSysroot) (sp := System.SearchPath.parse sp)
/-- Creates a Core.Context object needed to run all monads -/
@[export pantograph_create_core_context]
def createCoreContext (options: Array String): IO Lean.Core.Context := do