diff --git a/CMakeLists.txt b/CMakeLists.txt index 152b8df..de7567e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,7 +162,7 @@ function(link_and_include_deps target) # header-only libraries should be marked as "system includes" # to suppress compiler warnings in their code (it's not my problem after all) target_include_directories(${target} - SYSTEM + SYSTEM PRIVATE third-party/physfs/src third-party/physfs/extras @@ -171,6 +171,9 @@ function(link_and_include_deps target) third-party/stb ) + # allow access to headers from any point in source tree + target_include_directories(${target} PRIVATE ./) + target_link_libraries(${target} PUBLIC SDL2::SDL2 SDL2::SDL2main diff --git a/src/game/game.c b/src/game/game.c index 26f1812..d884f0f 100644 --- a/src/game/game.c +++ b/src/game/game.c @@ -1,6 +1,5 @@ #include "game.h" -#include "../textures.h" -#include "../game_api.h" +#include "townengine/game_api.h" #include "state.h" #include "scenes/scene.h" #include "scenes/title.h" diff --git a/src/game/game.h b/src/game/game.h index 6c67cdb..c3e0e8a 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -2,7 +2,7 @@ #define GAME_H -#include "../game_api.h" +#include "townengine/game_api.h" #include diff --git a/src/game/player.c b/src/game/player.c index 22d0ac4..d25302a 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -1,6 +1,6 @@ #include "player.h" #include "world.h" -#include "../game_api.h" +#include "townengine/game_api.h" #include diff --git a/src/game/player.h b/src/game/player.h index 6de0601..c8f14dc 100644 --- a/src/game/player.h +++ b/src/game/player.h @@ -2,7 +2,7 @@ #define PLAYER_H -#include "../game_api.h" +#include "townengine/game_api.h" struct world; diff --git a/src/game/scenes/ingame.c b/src/game/scenes/ingame.c index 0e5b268..98a21ab 100644 --- a/src/game/scenes/ingame.c +++ b/src/game/scenes/ingame.c @@ -2,7 +2,7 @@ #include "title.h" #include "scene.h" -#include "../../audio.h" +#include "townengine/game_api.h" static void ingame_tick(struct state *state) { diff --git a/src/game/scenes/ingame.h b/src/game/scenes/ingame.h index bf24e37..1eb8d67 100644 --- a/src/game/scenes/ingame.h +++ b/src/game/scenes/ingame.h @@ -2,7 +2,7 @@ #define INGAME_H -#include "../../game_api.h" +#include "townengine/game_api.h" #include "../state.h" #include "scene.h" #include "../player.h" diff --git a/src/game/scenes/title.c b/src/game/scenes/title.c index 7db88df..268f29b 100644 --- a/src/game/scenes/title.c +++ b/src/game/scenes/title.c @@ -2,7 +2,7 @@ #include "ingame.h" #include "../world.h" #include "../player.h" -#include "../../game_api.h" +#include "townengine/game_api.h" static void title_tick(struct state *state) { diff --git a/src/game/scenes/title.h b/src/game/scenes/title.h index 18fd876..450b0ea 100644 --- a/src/game/scenes/title.h +++ b/src/game/scenes/title.h @@ -2,7 +2,7 @@ #define TITLE_H -#include "../../game_api.h" +#include "townengine/game_api.h" #include "../state.h" #include "scene.h" #include "../player.h" diff --git a/src/game/state.h b/src/game/state.h index 865ac90..abb5325 100644 --- a/src/game/state.h +++ b/src/game/state.h @@ -2,7 +2,7 @@ #define STATE_H -#include "../game_api.h" +#include "townengine/game_api.h" struct state { diff --git a/src/game/world.c b/src/game/world.c index c1c9752..61ea2d1 100644 --- a/src/game/world.c +++ b/src/game/world.c @@ -1,5 +1,5 @@ #include "world.h" -#include "../game_api.h" +#include "townengine/game_api.h" #include #include diff --git a/src/game/world.h b/src/game/world.h index 9abd2f0..6480ec1 100644 --- a/src/game/world.h +++ b/src/game/world.h @@ -1,7 +1,7 @@ #ifndef WORLD_H #define WORLD_H -#include "../game_api.h" +#include "townengine/game_api.h" #include #include diff --git a/townengine b/townengine new file mode 120000 index 0000000..e831038 --- /dev/null +++ b/townengine @@ -0,0 +1 @@ +src \ No newline at end of file