Mercurial
view third_party/raylib/raylib.bzl @ 204:e5aed6c36672
[Notes] Added icons and updated styling a bit. Probalby usable now.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sun, 15 Feb 2026 11:02:13 -0800 |
| parents | 94705b5986b3 |
| children |
line wrap: on
line source
load("@rules_cc//cc:cc_binary.bzl", "cc_binary") def raylib_binary( name, srcs, deps = [], data = [], deps_macos = [], deps_linux = [], deps_windows = [], linkopts_macos = [ "-framework CoreVideo", "-framework IOKit", "-framework Cocoa", "-framework GLUT", "-framework OpenGL", ], linkopts_linux = [ "-lm", "-lpthread", "-ldl", "-lrt", "-lX11", ], linkopts_windows = [ "/DEFAULTLIB:winmm.lib", "/DEFAULTLIB:gdi32.lib", "/DEFAULTLIB:opengl32.lib", "/DEFAULTLIB:user32.lib", "/DEFAULTLIB:shell32.lib", ], # I am not sure what these do lol linkopts_wasm = [ "-sUSE_GLFW=3", # Tells Emscripten to provide GLFW3 compatibility "-sUSE_WEBGL2=1", # Enables WebGL2 support "-sASYNCIFY", # Often needed for Raylib's main loop if not using emscripten_set_main_loop ], 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. linkopts_windows: Extra linkopts for Windows. static: Make build executable static """ cc_binary( name = name, srcs = srcs, data = data, deps = deps + select({ "//config:macos": deps_macos, "//config:linux": deps_linux, "//config:windows": deps_windows, "//conditions:default": [], }), linkopts = select({ "//config:macos": linkopts_macos, "//config:linux": linkopts_linux, "//config:windows": linkopts_windows, "//conditions:default": linkopts_wasm, }), linkstatic = static, )