annotate third_party/raylib/raylib.bzl @ 190:a2725419f988 hg-web

Updated so that bun builds will with already existing js files.
author MrJuneJune <me@mrjunejune.com>
date Sat, 24 Jan 2026 21:06:42 -0800
parents 94705b5986b3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
177
24fe8ff94056 Fixed few issues with current setup.
MrJuneJune <me@mrjunejune.com>
parents: 166
diff changeset
1 load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
24fe8ff94056 Fixed few issues with current setup.
MrJuneJune <me@mrjunejune.com>
parents: 166
diff changeset
2
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
3 def raylib_binary(
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
4 name,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
5 srcs,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
6 deps = [],
114
e2a73e64e8e6 [Postdog] Got history working.
June Park <parkjune1995@gmail.com>
parents: 71
diff changeset
7 data = [],
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
8 deps_macos = [],
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
9 deps_linux = [],
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
10 deps_windows = [],
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
11 linkopts_macos = [
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
12 "-framework CoreVideo",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
13 "-framework IOKit",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
14 "-framework Cocoa",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
15 "-framework GLUT",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
16 "-framework OpenGL",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
17 ],
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
18 linkopts_linux = [
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
19 "-lm",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
20 "-lpthread",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
21 "-ldl",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
22 "-lrt",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
23 "-lX11",
58
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
24 ],
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
25 linkopts_windows = [
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
26 "/DEFAULTLIB:winmm.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
27 "/DEFAULTLIB:gdi32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
28 "/DEFAULTLIB:opengl32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
29 "/DEFAULTLIB:user32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
30 "/DEFAULTLIB:shell32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
31 ],
178
94705b5986b3 [ThirdParty] Added WRK and luajit for load testing.
MrJuneJune <me@mrjunejune.com>
parents: 177
diff changeset
32 # I am not sure what these do lol
94705b5986b3 [ThirdParty] Added WRK and luajit for load testing.
MrJuneJune <me@mrjunejune.com>
parents: 177
diff changeset
33 linkopts_wasm = [
94705b5986b3 [ThirdParty] Added WRK and luajit for load testing.
MrJuneJune <me@mrjunejune.com>
parents: 177
diff changeset
34 "-sUSE_GLFW=3", # Tells Emscripten to provide GLFW3 compatibility
94705b5986b3 [ThirdParty] Added WRK and luajit for load testing.
MrJuneJune <me@mrjunejune.com>
parents: 177
diff changeset
35 "-sUSE_WEBGL2=1", # Enables WebGL2 support
94705b5986b3 [ThirdParty] Added WRK and luajit for load testing.
MrJuneJune <me@mrjunejune.com>
parents: 177
diff changeset
36 "-sASYNCIFY", # Often needed for Raylib's main loop if not using emscripten_set_main_loop
94705b5986b3 [ThirdParty] Added WRK and luajit for load testing.
MrJuneJune <me@mrjunejune.com>
parents: 177
diff changeset
37 ],
58
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
38 static = False
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
39 ):
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
40 """
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
41 Raylib specific cross platform rules.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
42 Args:
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
43 name: The logical name of the binary (alias).
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
44 srcs: List of source files (common).
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
45 deps: Mutual dependency.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
46 deps_macos: Extra deps for macOS.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
47 deps_linux: Extra deps for Linux.
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
48 deps_windows: Extra deps for Windows.
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
49 linkopts_macos: Extra linkopts for macOS.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
50 linkopts_linux: Extra linkopts for Linux.
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
51 linkopts_windows: Extra linkopts for Windows.
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
52 static: Make build executable static
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
53 """
177
24fe8ff94056 Fixed few issues with current setup.
MrJuneJune <me@mrjunejune.com>
parents: 166
diff changeset
54 cc_binary(
71
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
55 name = name,
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
56 srcs = srcs,
114
e2a73e64e8e6 [Postdog] Got history working.
June Park <parkjune1995@gmail.com>
parents: 71
diff changeset
57 data = data,
71
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
58 deps = deps + select({
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
59 "//config:macos": deps_macos,
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
60 "//config:linux": deps_linux,
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
61 "//config:windows": deps_windows,
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
62 "//conditions:default": [],
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
63 }),
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
64 linkopts = select({
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
65 "//config:macos": linkopts_macos,
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
66 "//config:linux": linkopts_linux,
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
67 "//config:windows": linkopts_windows,
178
94705b5986b3 [ThirdParty] Added WRK and luajit for load testing.
MrJuneJune <me@mrjunejune.com>
parents: 177
diff changeset
68 "//conditions:default": linkopts_wasm,
71
75de5903355c Giagantic changes that update Dowa library to be more align with stb style array and hashmap. Updated Seobeo to be caching on server side instead of file level caching. Deleted bunch of things I don't really use.
June Park <parkjune1995@gmail.com>
parents: 61
diff changeset
69 }),
58
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
70 linkstatic = static,
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
71 )