Move device to a separate build target

This commit is contained in:
Pyrex 2024-02-25 16:40:33 -08:00
parent 4866226840
commit 56eaee9d08
7 changed files with 12 additions and 5 deletions

6
device/BUILD Normal file
View File

@ -0,0 +1,6 @@
cc_library(
name = "device",
srcs = glob(["*.c"]),
hdrs = glob(["*.h"]),
visibility = ["//visibility:public"]
)

View File

@ -2,5 +2,6 @@ cc_library(
name = "game", name = "game",
srcs = glob(["*.c"]), srcs = glob(["*.c"]),
hdrs = glob(["*.h"]), hdrs = glob(["*.h"]),
visibility = ["//sdl_host:__pkg__"] visibility = ["//visibility:public"],
) deps = ["//device:device"]
)

View File

@ -1,4 +1,4 @@
#include "device.h" #include "device/device.h"
#include "game.h" #include "game.h"
uint32_t game_frame; uint32_t game_frame;

View File

@ -1,5 +1,5 @@
cc_binary( cc_binary(
name = "sdl_host", name = "sdl_host",
srcs = glob(["*.c", "*.h"]), srcs = glob(["*.c", "*.h"]),
deps = ["//game:game", "//sdl:sdl"], deps = ["//device:device", "//game:game", "//sdl:sdl"],
) )

View File

@ -4,8 +4,8 @@
// don't use sdl's redefinition of main // don't use sdl's redefinition of main
#define SDL_MAIN_HANDLED #define SDL_MAIN_HANDLED
#include "sdl/include/SDL.h" #include "sdl/include/SDL.h"
#include "device/device.h"
#include "game/game.h" #include "game/game.h"
#include "game/device.h"
void sdl_host_suggest_dimensions(uint32_t* window_w, uint32_t* window_h); void sdl_host_suggest_dimensions(uint32_t* window_w, uint32_t* window_h);
void sdl_host_loop(); void sdl_host_loop();