Skip to content

Commit f124e6b

Browse files
committed
latest
1 parent df56977 commit f124e6b

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

bindings/sdl2-shim.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <lean/lean.h>
22

3-
#include <SDL2/SDL.h>
4-
#include <SDL2/SDL_image.h>
5-
#include <SDL2/SDL_timer.h>
3+
#include <SDL.h>
4+
#include <SDL_image.h>
5+
#include <SDL_timer.h>
66

77
/**
88
* Unwrap an Option of an external object as data for some
@@ -692,4 +692,4 @@ lean_obj_res lean_sdl_event_to_mouse_wheel_event_data(lean_obj_arg s) {
692692
)))));
693693

694694
return tuple;
695-
}
695+
}

lake-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"version": 7,
1+
{"version": "1.1.0",
22
"packagesDir": ".lake/packages",
33
"packages": [],
44
"name": "SDL",

lakefile.lean

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import Lean
12
import Lake
23
open Lake DSL
34

45
package «SDL» {
56
moreLinkArgs := #["-L.lake/build/lib", "-lsdl2-shim", "-lSDL2", "-lSDL2_image"]
6-
extraDepTargets := #["sdl2-shim"]
7+
extraDepTargets := #[Lean.Name.mkStr1 "sdl2-shim"]
78
}
89

910
lean_lib «SDL» {
@@ -15,15 +16,17 @@ def ffiSrc := "sdl2-shim.c"
1516
def ffiO := "sdl2-shim.o"
1617
def ffiLib := "sdl2-shim"
1718

18-
target ffi.o pkg : FilePath := do
19+
target ffi.o pkg : System.FilePath := do
1920
let oFile := pkg.buildDir / ffiO
20-
let srcJob ← inputFile <| pkg.dir / cDir / ffiSrc
21+
let srcJob ← inputFile (text:=.true) <| pkg.dir / cDir / ffiSrc
22+
let cflags <- captureProc { cmd := "sdl2-config", args := #["--cflags"]}
23+
let cflags := cflags.splitOn " "
2124
buildFileAfterDep oFile srcJob fun srcFile => do
2225
let flags := #["-I", (← getLeanIncludeDir).toString,
2326
"-I", (<- IO.getEnv "C_INCLUDE_PATH").getD "", "-fPIC"]
24-
compileO ffiSrc oFile srcFile flags
27+
compileO oFile srcFile (cflags.toArray ++ flags)
2528

26-
target «sdl2-shim» pkg : FilePath := do
29+
target «sdl2-shim» pkg : System.FilePath := do
2730
let name := nameToStaticLib ffiLib
2831
let ffiO ← fetch <| pkg.target ``ffi.o
2932
buildStaticLib (pkg.buildDir / "lib" / name) #[ffiO]

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.4.0
1+
leanprover/lean4:v4.26.0

0 commit comments

Comments
 (0)