From 9085ae8da25bcaf5f2a8866502de07bf18279c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Tue, 19 Jan 2021 11:43:56 +0100 Subject: [PATCH] code: make modules standalone --- code/apps/server/CMakeLists.txt | 7 +++---- code/apps/server/modules/CMakeLists.txt | 3 +++ code/apps/server/{header => modules}/modules/controllers.h | 0 code/apps/server/{header => modules}/modules/general.h | 0 code/apps/server/{header => modules}/modules/net.h | 0 code/apps/server/{header => modules}/modules/physics.h | 0 .../{source/modules => modules/source}/controllers.c | 0 .../server/{source/modules => modules/source}/general.c | 0 code/apps/server/{source/modules => modules/source}/net.c | 0 .../server/{source/modules => modules/source}/physics.c | 0 10 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 code/apps/server/modules/CMakeLists.txt rename code/apps/server/{header => modules}/modules/controllers.h (100%) rename code/apps/server/{header => modules}/modules/general.h (100%) rename code/apps/server/{header => modules}/modules/net.h (100%) rename code/apps/server/{header => modules}/modules/physics.h (100%) rename code/apps/server/{source/modules => modules/source}/controllers.c (100%) rename code/apps/server/{source/modules => modules/source}/general.c (100%) rename code/apps/server/{source/modules => modules/source}/net.c (100%) rename code/apps/server/{source/modules => modules/source}/physics.c (100%) diff --git a/code/apps/server/CMakeLists.txt b/code/apps/server/CMakeLists.txt index dd7c477..750457c 100644 --- a/code/apps/server/CMakeLists.txt +++ b/code/apps/server/CMakeLists.txt @@ -1,5 +1,4 @@ -file(GLOB MODULES header/modules/*.h source/modules/*.c) -add_library(eco2d-server-modules STATIC ${MODULES}) +add_subdirectory(modules) add_executable(eco2d-server source/main.c @@ -17,6 +16,6 @@ add_executable(eco2d-server header/world/blocks_info.h ) -include_directories(eco2d-server header) -target_link_libraries(eco2d-server eco2d-common eco2d-server-modules flecs-bundle cwpack) +include_directories(eco2d-server header modules) +target_link_libraries(eco2d-server eco2d-common eco2d-modules flecs-bundle cwpack) link_system_libs(eco2d-server) diff --git a/code/apps/server/modules/CMakeLists.txt b/code/apps/server/modules/CMakeLists.txt new file mode 100644 index 0000000..b1c5672 --- /dev/null +++ b/code/apps/server/modules/CMakeLists.txt @@ -0,0 +1,3 @@ +file(GLOB MODULES modules/*.h source/*.c) +add_library(eco2d-modules STATIC ${MODULES}) +include_directories(eco2d-modules .) diff --git a/code/apps/server/header/modules/controllers.h b/code/apps/server/modules/modules/controllers.h similarity index 100% rename from code/apps/server/header/modules/controllers.h rename to code/apps/server/modules/modules/controllers.h diff --git a/code/apps/server/header/modules/general.h b/code/apps/server/modules/modules/general.h similarity index 100% rename from code/apps/server/header/modules/general.h rename to code/apps/server/modules/modules/general.h diff --git a/code/apps/server/header/modules/net.h b/code/apps/server/modules/modules/net.h similarity index 100% rename from code/apps/server/header/modules/net.h rename to code/apps/server/modules/modules/net.h diff --git a/code/apps/server/header/modules/physics.h b/code/apps/server/modules/modules/physics.h similarity index 100% rename from code/apps/server/header/modules/physics.h rename to code/apps/server/modules/modules/physics.h diff --git a/code/apps/server/source/modules/controllers.c b/code/apps/server/modules/source/controllers.c similarity index 100% rename from code/apps/server/source/modules/controllers.c rename to code/apps/server/modules/source/controllers.c diff --git a/code/apps/server/source/modules/general.c b/code/apps/server/modules/source/general.c similarity index 100% rename from code/apps/server/source/modules/general.c rename to code/apps/server/modules/source/general.c diff --git a/code/apps/server/source/modules/net.c b/code/apps/server/modules/source/net.c similarity index 100% rename from code/apps/server/source/modules/net.c rename to code/apps/server/modules/source/net.c diff --git a/code/apps/server/source/modules/physics.c b/code/apps/server/modules/source/physics.c similarity index 100% rename from code/apps/server/source/modules/physics.c rename to code/apps/server/modules/source/physics.c