annotate third_party/raylib/raylib.bzl @ 66:a0f0ad5e42eb

[Misc] taking out capital P stuff.
author June Park <parkjune1995@gmail.com>
date Wed, 24 Dec 2025 06:34:19 -0800
parents 9df5587cf23b
children 75de5903355c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
1 def raylib_binary(
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
2 name,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
3 srcs,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
4 deps = [],
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
5 deps_macos = [],
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
6 deps_linux = [],
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
7 deps_windows = [],
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
8 linkopts_macos = [
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
9 "-framework CoreVideo",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
10 "-framework IOKit",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
11 "-framework Cocoa",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
12 "-framework GLUT",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
13 "-framework OpenGL",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
14 ],
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
15 linkopts_linux = [
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
16 "-lGL",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
17 "-lm",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
18 "-lpthread",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
19 "-ldl",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
20 "-lrt",
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
21 "-lX11",
58
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
22 ],
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
23 linkopts_windows = [
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
24 "/DEFAULTLIB:winmm.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
25 "/DEFAULTLIB:gdi32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
26 "/DEFAULTLIB:opengl32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
27 "/DEFAULTLIB:user32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
28 "/DEFAULTLIB:shell32.lib",
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
29 ],
58
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
30 static = False
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
31 ):
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
32 """
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
33 Raylib specific cross platform rules.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
34 Args:
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
35 name: The logical name of the binary (alias).
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
36 srcs: List of source files (common).
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
37 deps: Mutual dependency.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
38 deps_macos: Extra deps for macOS.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
39 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
40 deps_windows: Extra deps for Windows.
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
41 linkopts_macos: Extra linkopts for macOS.
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
42 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
43 linkopts_windows: Extra linkopts for Windows.
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
44 static: Make build executable static
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
45 """
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
46 macos_bin = name + "_macos"
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
47 linux_bin = name + "_linux"
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
48 windows_bin = name + "_windows"
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
49
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
50 native.cc_binary(
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
51 name = macos_bin,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
52 srcs = srcs,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
53 deps = deps + deps_macos,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
54 linkopts = linkopts_macos,
58
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
55 linkstatic = static,
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
56 )
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
57
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
58 native.cc_binary(
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
59 name = linux_bin,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
60 srcs = srcs,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
61 deps = deps + deps_linux,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
62 linkopts = linkopts_linux,
58
ccb42d5bf8fd [PostDog] Somewhat working copy. That would use for testing.
June Park <parkjune1995@gmail.com>
parents: 26
diff changeset
63 linkstatic = static,
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
64 )
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
65
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
66 native.cc_binary(
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
67 name = windows_bin,
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
68 srcs = srcs,
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
69 deps = deps + deps_windows,
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
70 linkopts = linkopts_windows,
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
71 linkstatic = static,
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
72 )
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
73
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
74 native.alias(
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
75 name = name,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
76 actual = select({
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
77 "//config:macos": ":" + macos_bin,
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
78 "//config:linux": ":" + linux_bin,
61
9df5587cf23b [Color game] It can compile on windows now.
June Park <me@mrjunejune.com>
parents: 58
diff changeset
79 "//config:windows": ":" + windows_bin,
26
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
80 "//conditions:default": ":" + linux_bin, # fallback
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
81 }),
a58a663dae68 [Sori] Making a simple game.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
82 )