From 84c351c621892936606c522206d130c33a4c3261 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Tue, 14 Oct 2025 11:39:06 -0500 Subject: [PATCH] chore(build): split out component lib --- src/CMakeLists.txt | 1 + .../CCharacterComponent.cpp | 2 +- .../CCharacterComponent.hpp | 4 ++-- src/component/CMakeLists.txt | 18 ++++++++++++++++++ src/glue/CCharacterSelection.cpp | 2 +- src/glue/CMakeLists.txt | 1 + 6 files changed, 24 insertions(+), 4 deletions(-) rename src/{glue => component}/CCharacterComponent.cpp (95%) rename src/{glue => component}/CCharacterComponent.hpp (89%) create mode 100644 src/component/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ddc1b91..f69b076 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,7 @@ add_subdirectory(app) add_subdirectory(async) add_subdirectory(client) +add_subdirectory(component) add_subdirectory(console) add_subdirectory(db) add_subdirectory(event) diff --git a/src/glue/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp similarity index 95% rename from src/glue/CCharacterComponent.cpp rename to src/component/CCharacterComponent.cpp index 2762cb4..37b4ced 100644 --- a/src/glue/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -1,4 +1,4 @@ -#include "glue/CCharacterComponent.hpp" +#include "component/CCharacterComponent.hpp" #include "model/CM2Model.hpp" #include diff --git a/src/glue/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp similarity index 89% rename from src/glue/CCharacterComponent.hpp rename to src/component/CCharacterComponent.hpp index 5069ba8..ba6b0f9 100644 --- a/src/glue/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -1,5 +1,5 @@ -#ifndef GLUE_C_CHARACTER_COMPONENT_HPP -#define GLUE_C_CHARACTER_COMPONENT_HPP +#ifndef COMPONENT_C_CHARACTER_COMPONENT_HPP +#define COMPONENT_C_CHARACTER_COMPONENT_HPP #include diff --git a/src/component/CMakeLists.txt b/src/component/CMakeLists.txt new file mode 100644 index 0000000..30c1fe0 --- /dev/null +++ b/src/component/CMakeLists.txt @@ -0,0 +1,18 @@ +file(GLOB PRIVATE_SOURCES "*.cpp") + +add_library(component STATIC + ${PRIVATE_SOURCES} +) + +target_include_directories(component + PRIVATE + ${CMAKE_SOURCE_DIR}/src +) + +target_link_libraries(component + PRIVATE + db + model + PUBLIC + storm +) diff --git a/src/glue/CCharacterSelection.cpp b/src/glue/CCharacterSelection.cpp index 39fe7d7..c32091a 100644 --- a/src/glue/CCharacterSelection.cpp +++ b/src/glue/CCharacterSelection.cpp @@ -1,7 +1,7 @@ #include "glue/CCharacterSelection.hpp" #include "client/ClientServices.hpp" +#include "component/CCharacterComponent.hpp" #include "db/Db.hpp" -#include "glue/CCharacterComponent.hpp" #include "glue/CGlueMgr.hpp" #include "glue/CRealmList.hpp" #include "glue/Types.hpp" diff --git a/src/glue/CMakeLists.txt b/src/glue/CMakeLists.txt index 5e3a357..9708864 100644 --- a/src/glue/CMakeLists.txt +++ b/src/glue/CMakeLists.txt @@ -12,6 +12,7 @@ target_include_directories(glue target_link_libraries(glue PRIVATE client + component console db event