- Remove old 10-engine system (engines/ directory deleted) - Implement C++ triple interface architecture: * IEngine: Execution coordination (Debug → Production) * IModuleSystem: Strategy pattern (Sequential → Threaded → Cluster) * IModule: Pure game logic interface (200-300 lines per module) * IIO: Communication transport (Intra → Local → Network) - Add autonomous module structure: * modules/factory/: Production logic with autonomous build * modules/economy/: Market simulation with autonomous build * modules/logistic/: Supply chain with autonomous build * Each module: CLAUDE.md + CMakeLists.txt + shared/ + build/ - Benefits for Claude Code development: * Ultra-focused contexts (200 lines vs 50K+ lines) * Autonomous builds (cmake . from module directory) * Hot-swappable infrastructure without logic changes * Parallel development across multiple Claude instances 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
69 lines
1.9 KiB
CMake
69 lines
1.9 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(FactoryModule LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Build configuration
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DDEBUG")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
endif()
|
|
|
|
# Output to local build directory
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
|
|
|
|
# Include local shared headers
|
|
include_directories(shared)
|
|
|
|
# Factory module as shared library (.so)
|
|
add_library(factory-module SHARED
|
|
src/FactoryModule.cpp
|
|
)
|
|
|
|
# Set library properties for .so generation
|
|
set_target_properties(factory-module PROPERTIES
|
|
PREFIX "" # No "lib" prefix
|
|
SUFFIX ".so" # Force .so extension
|
|
OUTPUT_NAME "factory"
|
|
)
|
|
|
|
# Test executable (optional)
|
|
add_executable(factory-test
|
|
src/FactoryModule.cpp
|
|
tests/FactoryTest.cpp
|
|
)
|
|
|
|
# Standalone executable for testing
|
|
add_executable(factory-standalone
|
|
src/FactoryModule.cpp
|
|
src/main.cpp
|
|
)
|
|
|
|
# Build targets
|
|
add_custom_target(build-factory
|
|
DEPENDS factory-module
|
|
COMMENT "Building factory.so module"
|
|
)
|
|
|
|
add_custom_target(test-factory
|
|
DEPENDS factory-test
|
|
COMMAND ./build/factory-test
|
|
COMMENT "Running factory module tests"
|
|
)
|
|
|
|
# Clean local build
|
|
add_custom_target(clean-factory
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory build
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory build
|
|
COMMENT "Cleaning factory module build"
|
|
)
|
|
|
|
message(STATUS "🏭 Factory Module configured:")
|
|
message(STATUS " cmake . : Configure")
|
|
message(STATUS " make factory-module : Build factory.so")
|
|
message(STATUS " make test-factory : Run tests")
|
|
message(STATUS " make clean-factory : Clean build") |