Size: 4302 bytes.


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# cs/apps/trycopilot.ai/BUILD
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@emsdk//emscripten_toolchain:wasm_rules.bzl", "wasm_cc_binary")
load("//cs/devtools:embed_files.bzl", "embed_files_cc")

package(default_visibility = ["//visibility:public"])

cc_library(
    name = "fps_counter",
    hdrs = ["fps_counter.hh"],
)

# Exclude this library from the main build since the wasm_cc_binary
# below will compile the index.cc file with the emscripten SDK.
cc_library(
    name = "scene_animator",
    srcs = ["scene_animator.hh"],
    tags = ["manual"],
    deps = [
        "//cs/apps/trycopilot.ai/text/fonts:mono",
        "//cs/renderer:rainbow",
        "//cs/renderer:scene_renderer",
        "//cs/renderer/geo:point3",
        "//cs/renderer/geo:ray3",
        "//cs/renderer/geo:vector3",
        "//cs/renderer/linalg:transform",
        "//cs/renderer/numbers:map_value",
        "//cs/renderer/shapes:plane",
        "//cs/renderer/shapes:shape",
        "//cs/renderer/shapes:sphere",
        "//cs/util:timeit",
    ],
)

cc_test(
    name = "scene_animator_test_gpt_cc",
    srcs = ["scene_animator_test.gpt.cc"],
    deps = [
        "//cs:result",
        "//cs/apps/trycopilot.ai:scene_animator",
        "@googletest//:gtest_main",
    ],
)

cc_binary(
    name = "index",
    srcs = ["index.cc"],
    linkopts = [
        "-sASYNCIFY=1",
        "-sUSE_SDL=1",
        "-sALLOW_MEMORY_GROWTH",
        "-sEXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\", \"requestFullscreen\"]'",
        "-sFETCH=1",
        "-sASSERTIONS",
    ],
    # Exclude this library from the main build since the wasm_cc_binary
    # below will compile the index.cc file with the emscripten SDK.
    tags = ["manual"],
    deps = [
        "//cs/apps/trycopilot.ai:scene1",
        "//cs/apps/trycopilot.ai:scene_animator",
        "//cs/apps/trycopilot.ai/emscripten",
        "//cs/apps/trycopilot.ai/protos:auth.proto",
        "//cs/apps/trycopilot.ai/protos:game.proto",
        "//cs/apps/trycopilot.ai/protos:user.proto",
        "//cs/apps/trycopilot.ai/protos:uuid.proto",
        "//cs/renderer:film",
        "//cs/renderer:pixel",
        "//cs/util:timeit",
    ],
)

wasm_cc_binary(
    name = "index.js",
    cc_target = ":index",
)

embed_files_cc(
    name = "index_embedded",
    srcs = [":index.js"],
    prefix = "indexjs",
)

cc_binary(
    name = "main",
    srcs = [
        "main.cc",
    ],
    data = [
        "//cs/apps/trycopilot.ai:index.js",
    ],
    deps = [
        ":index_embedded",
        "//cs:result",
        "//cs/apps/common:health_endpoint",
        "//cs/apps/common:load_endpoint",
        "//cs/apps/service-registry:rpc",
        "//cs/apps/trycopilot.ai:scene1",
        "//cs/apps/trycopilot.ai:scene_animator",
        "//cs/apps/trycopilot.ai/api:auth",
        "//cs/apps/trycopilot.ai/api:game",
        "//cs/apps/trycopilot.ai/api:prompt",
        "//cs/apps/trycopilot.ai/api:prompt_driver",
        "//cs/apps/trycopilot.ai/api:user",
        "//cs/apps/trycopilot.ai/protos:acl.proto",
        "//cs/apps/trycopilot.ai/protos:auth.proto",
        "//cs/apps/trycopilot.ai/protos:config.proto",
        "//cs/apps/trycopilot.ai/protos:prompt.proto",
        "//cs/apps/trycopilot.ai/protos:prompt_driver.proto",
        "//cs/apps/trycopilot.ai/protos:ui.proto",
        "//cs/apps/trycopilot.ai/protos:user.proto",
        "//cs/apps/trycopilot.ai/protos:uuid.proto",
        "//cs/apps/trycopilot.ai/protos:web_app_meta.proto",
        "//cs/apps/trycopilot.ai/ui",
        "//cs/fs",
        "//cs/net/http:favicon",
        "//cs/net/http:request",
        "//cs/net/http:response",
        "//cs/net/http:web_app",
        "//cs/net/json:object",
        "//cs/net/json:parsers",
        "//cs/net/json:serialize",
        "//cs/net/proto/db",
        "//cs/net/proto/db:client",
        "//cs/net/proto/db:database_base_url",
        "//cs/net/rpc",
        "//cs/parsers:arg_parser",
        "//cs/renderer:film",
        "//cs/renderer:pixel",
        "//cs/util:context",
        "//cs/util:embedded_files",
        "//cs/util:timeit",
        "//cs/util:uuid",
        "//cs/util/di:context",
        "@bazel_tools//tools/cpp/runfiles",
    ],
)

cc_library(
    name = "scene1",
    hdrs = ["scene1.hh"],
)
v0 (commit) © 2025 @p13i.io | Load balancer proxied to: cs-code-viewer-2:8080 in 4ms.