-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
72 lines (59 loc) · 2.07 KB
/
justfile
File metadata and controls
72 lines (59 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Raylib CUSTOM_FLAGS tailed for the current os
#
# The macos differ from the raylib release workflow.
# We require `-fno-objc-msgsend-selector-stubs` to be set.
#
# If this is not set then the clang 15 linker bundled with lean gives the
# following error:
#
# ld64.lld: error: undefined symbol: _objc_msgSend$update
#
# See https://stackoverflow.com/a/74054943
#
raylib_os_custom_cflags := if os() == "macos" { "-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION -fno-objc-msgsend-selector-stubs" } else { "" }
# Enable extra raylib configuration flags
raylib_config_flags := ""
# Raylib CUSTOM_CFLAGS make parameter
raylib_custom_cflags := raylib_config_flags + " " + raylib_os_custom_cflags
# Raylib CC make paramter
raylib_cc_parameter := if os() == "macos" { "/usr/bin/clang" } else { "gcc" }
# Raylib extra Makefile variables
#
# e.g add "USE_WAYLAND_DISPLAY=TRUE" to build Raylib with Wayland support.
raylib_extra_make_variables := ""
static_lib_path := join(justfile_directory(), "lib")
raylib_src_path := join(justfile_directory(), "raylib-5.0", "src")
[private]
default:
@just --list
# build only the raylib static library
build_raylib:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f "{{static_lib_path}}/libraylib.a" ]; then
mkdir -p {{static_lib_path}}
make -C {{raylib_src_path}} \
CC={{raylib_cc_parameter}} \
PLATFORM=PLATFORM_DESKTOP \
RAYLIB_LIBTYPE=STATIC \
RAYLIB_RELEASE_PATH={{static_lib_path}} \
{{raylib_extra_make_variables}} \
CUSTOM_CFLAGS="{{raylib_custom_cflags}}"
fi
# build both the raylib library and the Lake project
build: build_raylib
lake build
# clean only the Lake project
clean:
lake clean
clean_static_lib:
rm -rf {{static_lib_path}}
# clean only the raylib build
clean_raylib:
make -C {{raylib_src_path}} clean
rm -rf {{static_lib_path}}/libraylib.a
# clean both the raylib build and the Lake project
clean_all: clean clean_raylib clean_static_lib
# run the demo executable
run *demoName: build
.lake/build/bin/orbital {{demoName}}