Files
lean-sdl3/justfile
T

57 lines
1.4 KiB
Makefile
Raw Normal View History

2026-09-08 15:23:49 -07:00
# Lean runs `main` on a helper thread by default; Cocoa only creates a video device on the main thread.
export LEAN_MAIN_USE_THREAD := if os() == "macos" { "0" } else { "1" }
2025-12-01 03:08:08 -08:00
_default:
@just --list
2026-01-19 19:50:10 -08:00
[doc: "Build the general test app"]
[group: "build"]
build-test-app:
@just _build test-app
@just _perform_nix_patch test-app
2025-12-01 03:08:08 -08:00
2026-01-19 19:50:10 -08:00
[doc: "Build the general test app"]
[group: "run"]
run-test-app: build-test-app
2025-12-01 03:08:08 -08:00
.lake/build/bin/test-app
2026-01-19 19:50:10 -08:00
[doc: "Build the webcam demo"]
[group: "build"]
build-webcam-demo:
@just _build webcam-app
@just _perform_nix_patch webcam-app
[doc: "Run the webcam demo"]
[group: "run"]
run-webcam-demo: build-webcam-demo
.lake/build/bin/webcam-app
2026-01-19 19:50:10 -08:00
_build binary-name:
2026-01-19 19:50:45 -08:00
lake build {{binary-name}} --verbose
2026-01-19 19:50:10 -08:00
[linux]
2026-01-19 19:50:10 -08:00
_perform_nix_patch binary-name:
patchelf --set-interpreter /usr/lib/ld-linux-x86-64.so.2 .lake/build/bin/{{binary-name}}
patchelf --set-rpath '$ORIGIN:/usr/lib' .lake/build/bin/{{binary-name}}
2026-07-08 22:28:38 -07:00
[macos]
_perform_nix_patch binary-name:
@true
2026-07-08 22:28:38 -07:00
# Build the C version of the SDL3 webcam
[group: "C_build"]
build-c-webcam-demo:
@just _build-c-example examples/sdl-webcam-example.c c-webcam-example
2026-07-13 20:41:26 -07:00
[group: "C_build"]
build-c-gamepad-example:
@just _build-c-example examples/sdl-gamepad-example.c c-gamepad-example
2026-07-08 22:28:38 -07:00
# Build one of the C SDL3 examples
[group: "C_build"]
_build-c-example c-sourcefile binary-name:
gcc -lSDL3 {{c-sourcefile}} -o {{binary-name}}