diff --git a/device/BUILD b/device/BUILD new file mode 100644 index 0000000..be33350 --- /dev/null +++ b/device/BUILD @@ -0,0 +1,6 @@ +cc_library( + name = "device", + srcs = glob(["*.c"]), + hdrs = glob(["*.h"]), + visibility = ["//visibility:public"] +) \ No newline at end of file diff --git a/game/device.c b/device/device.c similarity index 100% rename from game/device.c rename to device/device.c diff --git a/game/device.h b/device/device.h similarity index 100% rename from game/device.h rename to device/device.h diff --git a/game/BUILD b/game/BUILD index c36d3f6..5fb7a5b 100644 --- a/game/BUILD +++ b/game/BUILD @@ -2,5 +2,6 @@ cc_library( name = "game", srcs = glob(["*.c"]), hdrs = glob(["*.h"]), - visibility = ["//sdl_host:__pkg__"] -) + visibility = ["//visibility:public"], + deps = ["//device:device"] +) \ No newline at end of file diff --git a/game/game.c b/game/game.c index be0896f..07c63eb 100644 --- a/game/game.c +++ b/game/game.c @@ -1,4 +1,4 @@ -#include "device.h" +#include "device/device.h" #include "game.h" uint32_t game_frame; diff --git a/sdl_host/BUILD b/sdl_host/BUILD index a860225..7593244 100644 --- a/sdl_host/BUILD +++ b/sdl_host/BUILD @@ -1,5 +1,5 @@ cc_binary( name = "sdl_host", srcs = glob(["*.c", "*.h"]), - deps = ["//game:game", "//sdl:sdl"], + deps = ["//device:device", "//game:game", "//sdl:sdl"], ) \ No newline at end of file diff --git a/sdl_host/main.c b/sdl_host/main.c index 26aca32..dc13113 100644 --- a/sdl_host/main.c +++ b/sdl_host/main.c @@ -4,8 +4,8 @@ // don't use sdl's redefinition of main #define SDL_MAIN_HANDLED #include "sdl/include/SDL.h" +#include "device/device.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_loop();