common/src/*.h -> common/include/

This commit is contained in:
snit 2024-10-02 19:42:30 -05:00
parent 8b04672d34
commit 391db5c444
11 changed files with 10 additions and 9 deletions

View File

@ -14,5 +14,5 @@ mkdir -p build/
cd build/
cmake ..
make
./simworld
server/simworld-daemon
```

View File

@ -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

View File

@ -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})

View File

@ -3,7 +3,7 @@
#include <stdlib.h>
#include "../error.h"
#include "error.h"
struct entity_registrant_t {
char const *name;

View File

@ -2,7 +2,7 @@
#include <assert.h>
#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);

View File

@ -3,7 +3,7 @@
#include <assert.h>
#include <string.h>
#include "registry.h"
#include "entity/registry.h"
#define MAX_NAME_LENGTH 32

View File

@ -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)

View File

@ -2,8 +2,8 @@
#include <stdio.h>
#include "render/render.h"
#include "world.h"
#include "render/render.h"
int main(void) {
enum error_t err = ERR_OK;