diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2026-02-10 17:05:11 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2026-02-10 17:05:11 +0100 |
| commit | 44796b1b1493a67dcdfec8f9846dce14e7ecf4a4 (patch) | |
| tree | 24e13002e43770ffcdaad84e0ce755f5035f511d /lakefile.lean | |
initial commit
Diffstat (limited to 'lakefile.lean')
| -rw-r--r-- | lakefile.lean | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lakefile.lean b/lakefile.lean new file mode 100644 index 0000000..ef12dad --- /dev/null +++ b/lakefile.lean @@ -0,0 +1,33 @@ +import Lean +import Lake +open Lake DSL + +package «CWayland» { + moreLinkArgs := #["-L.lake/build/lib", "-lLibCWayland"] + extraDepTargets := #[Lean.Name.mkStr1 "LibCWayland"] +} + +target «LibCWayland.o» pkg : System.FilePath := do + let objectFile := pkg.buildDir / "LibCWayland.o" + let srcJob ← inputFile (text := .true) <| pkg.dir / "lib" / "CWayland" / "CWayland.c" + -- let cFlags ← captureProc { cmd := "pkg-config", args := #["--cflags", "libwayland-client"] } + -- let cFlags := cFlags.splitOn " " + let cFlags := #[] + buildFileAfterDep objectFile srcJob (fun srcFile ↦ do + let cFlags := cFlags ++ #["-I", (← getLeanIncludeDir).toString, "-I", (← IO.getEnv "C_INCLUDE_PATH").getD "", "-fPIC"] + compileO objectFile srcFile cFlags) + +target «LibCWayland» pkg : System.FilePath := do + let name := nameToStaticLib "LibCWayland" + let objectFile ← fetch <| pkg.target (Lean.Name.mkStr1 "LibCWayland.o") + buildStaticLib (pkg.buildDir / "lib" / name) #[objectFile] + +lean_lib «Wayland» { + srcDir := "lib" + roots := #[`Wayland] +} + +lean_exe «Waylean» { + srcDir := "src" + root := `Waylean +} |
