diff --git a/README.gmi b/README.gmi index 815f69f..7307817 100644 --- a/README.gmi +++ b/README.gmi @@ -14,5 +14,5 @@ mkdir -p build/ cd build/ cmake .. make -./simworld +server/simworld-daemon ``` diff --git a/TODO.gmi b/TODO.gmi index 9327e18..b144e38 100644 --- a/TODO.gmi +++ b/TODO.gmi @@ -7,7 +7,7 @@ A list of things I'd like to accomplish * Create client to connect to daemon ## Completed -* Split into client and server (and common library?) +* Split into client, server, and common library * Write Makefile to automate compilation ## Planned diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index dd9064a..79641a9 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,16 +1,17 @@ # common/CMakeLists.txt cmake_minimum_required(VERSION 3.10) -project(libsimworld VERSION 0.0.1 LANGUAGES C) +project(simworld VERSION 0.0.1 LANGUAGES C) set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/common/src) file(GLOB_RECURSE SOURCES ${SOURCE_DIR}/*.c) add_library(${PROJECT_NAME} SHARED ${SOURCES}) -target_include_directories(${PROJECT_NAME} PUBLIC ${SOURCE_DIR}) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/common/include) find_package(PkgConfig REQUIRED) pkg_check_modules(LUA REQUIRED lua) target_link_libraries(${PROJECT_NAME} ${LUA_LIBRARIES}) + target_include_directories(${PROJECT_NAME} PRIVATE ${LUA_INCLUDE_DIRS}) diff --git a/common/src/entity/entity.h b/common/include/entity/entity.h similarity index 100% rename from common/src/entity/entity.h rename to common/include/entity/entity.h diff --git a/common/src/entity/registry.h b/common/include/entity/registry.h similarity index 96% rename from common/src/entity/registry.h rename to common/include/entity/registry.h index 9540d76..5d9d4f8 100644 --- a/common/src/entity/registry.h +++ b/common/include/entity/registry.h @@ -3,7 +3,7 @@ #include -#include "../error.h" +#include "error.h" struct entity_registrant_t { char const *name; diff --git a/common/src/error.h b/common/include/error.h similarity index 100% rename from common/src/error.h rename to common/include/error.h diff --git a/common/src/world.h b/common/include/world.h similarity index 100% rename from common/src/world.h rename to common/include/world.h diff --git a/common/src/entity/entity.c b/common/src/entity/entity.c index 7fbfa51..53a4d4f 100644 --- a/common/src/entity/entity.c +++ b/common/src/entity/entity.c @@ -2,7 +2,7 @@ #include -#include "entity.h" +#include "entity/entity.h" void entity_init(struct entity_t *self, size_t id, size_t x, size_t y) { assert(self != NULL); diff --git a/common/src/entity/registry.c b/common/src/entity/registry.c index fb3e792..c87f900 100644 --- a/common/src/entity/registry.c +++ b/common/src/entity/registry.c @@ -3,7 +3,7 @@ #include #include -#include "registry.h" +#include "entity/registry.h" #define MAX_NAME_LENGTH 32 diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 004cdd0..0b7076f 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -7,4 +7,4 @@ set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/server/src) file(GLOB_RECURSE SOURCES ${SOURCE_DIR}/*.c) add_executable(simworld-daemon ${SOURCES}) -target_link_libraries(${PROJECT_NAME} PRIVATE libsimworld) +target_link_libraries(${PROJECT_NAME} PRIVATE simworld) diff --git a/server/src/main.c b/server/src/main.c index 37eaf55..c72b73b 100644 --- a/server/src/main.c +++ b/server/src/main.c @@ -2,8 +2,8 @@ #include -#include "render/render.h" #include "world.h" +#include "render/render.h" int main(void) { enum error_t err = ERR_OK;