Mercurial
diff third_party/raylib/raylib.bzl @ 61:9df5587cf23b
[Color game] It can compile on windows now.
| author | June Park <me@mrjunejune.com> |
|---|---|
| date | Sat, 20 Dec 2025 21:07:34 -0500 |
| parents | ccb42d5bf8fd |
| children | 75de5903355c |
line wrap: on
line diff
--- a/third_party/raylib/raylib.bzl Sat Dec 20 13:56:01 2025 -0500 +++ b/third_party/raylib/raylib.bzl Sat Dec 20 21:07:34 2025 -0500 @@ -4,6 +4,7 @@ deps = [], deps_macos = [], deps_linux = [], + deps_windows = [], linkopts_macos = [ "-framework CoreVideo", "-framework IOKit", @@ -19,25 +20,33 @@ "-lrt", "-lX11", ], + linkopts_windows = [ + "/DEFAULTLIB:winmm.lib", + "/DEFAULTLIB:gdi32.lib", + "/DEFAULTLIB:opengl32.lib", + "/DEFAULTLIB:user32.lib", + "/DEFAULTLIB:shell32.lib", + ], static = False ): """ Raylib specific cross platform rules. - Args: name: The logical name of the binary (alias). srcs: List of source files (common). deps: Mutual dependency. deps_macos: Extra deps for macOS. deps_linux: Extra deps for Linux. + deps_windows: Extra deps for Windows. linkopts_macos: Extra linkopts for macOS. linkopts_linux: Extra linkopts for Linux. - static: Make build exectuable static + linkopts_windows: Extra linkopts for Windows. + static: Make build executable static """ - macos_bin = name + "_macos" linux_bin = name + "_linux" - + windows_bin = name + "_windows" + native.cc_binary( name = macos_bin, srcs = srcs, @@ -45,7 +54,7 @@ linkopts = linkopts_macos, linkstatic = static, ) - + native.cc_binary( name = linux_bin, srcs = srcs, @@ -53,12 +62,21 @@ linkopts = linkopts_linux, linkstatic = static, ) - + + native.cc_binary( + name = windows_bin, + srcs = srcs, + deps = deps + deps_windows, + linkopts = linkopts_windows, + linkstatic = static, + ) + native.alias( name = name, actual = select({ "//config:macos": ":" + macos_bin, "//config:linux": ":" + linux_bin, + "//config:windows": ":" + windows_bin, "//conditions:default": ":" + linux_bin, # fallback }), )