view third_party/raylib/raylib.bzl @ 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.
author June Park <parkjune1995@gmail.com>
date Sun, 28 Dec 2025 20:34:22 -0800
parents 9df5587cf23b
children e2a73e64e8e6
line wrap: on
line source

def raylib_binary(
        name,
        srcs,
        deps = [],
        deps_macos = [],
        deps_linux = [],
        deps_windows = [],
        linkopts_macos = [
          "-framework CoreVideo",
          "-framework IOKit",
          "-framework Cocoa",
          "-framework GLUT",
          "-framework OpenGL",
        ],
        linkopts_linux = [
          "-lGL",
          "-lm",
          "-lpthread",
          "-ldl",
          "-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.
        linkopts_windows: Extra linkopts for Windows.
        static: Make build executable static
    """
    native.cc_binary(
        name = name,
        srcs = srcs,
        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": [],
        }),
        linkstatic = static,
    )