- Architecture basée sur GroveEngine (hot-reload C++17) - Structure du projet (src, config, external) - CMakeLists.txt avec support MinGW - GameModule de base (hot-reloadable) - Main loop 10Hz avec file watcher - Configuration via JSON - Documentation README et CLAUDE.md ✅ Build fonctionnel ✅ Hot-reload validé 🚧 Prochaine étape: Prototype gameplay 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
78 lines
2.5 KiB
CMake
78 lines
2.5 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(MobileCommand VERSION 0.1.0 LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Export compile commands for IDE support
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
# ============================================================================
|
|
# GroveEngine Integration
|
|
# ============================================================================
|
|
set(GROVE_BUILD_TESTS OFF CACHE BOOL "Disable GroveEngine tests" FORCE)
|
|
set(GROVE_BUILD_MODULES OFF CACHE BOOL "Disable GroveEngine modules" FORCE)
|
|
add_subdirectory(external/GroveEngine)
|
|
|
|
# ============================================================================
|
|
# Dependencies
|
|
# ============================================================================
|
|
include(FetchContent)
|
|
|
|
# ============================================================================
|
|
# Main Executable
|
|
# ============================================================================
|
|
add_executable(mobilecommand
|
|
src/main.cpp
|
|
)
|
|
|
|
target_link_libraries(mobilecommand PRIVATE
|
|
GroveEngine::impl
|
|
spdlog::spdlog
|
|
)
|
|
|
|
target_include_directories(mobilecommand PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
)
|
|
|
|
# ============================================================================
|
|
# Hot-Reloadable Modules (.so/.dll) - Game modules
|
|
# ============================================================================
|
|
|
|
# GameModule - Core game loop
|
|
add_library(GameModule SHARED
|
|
src/modules/GameModule.cpp
|
|
)
|
|
target_link_libraries(GameModule PRIVATE
|
|
GroveEngine::impl
|
|
spdlog::spdlog
|
|
)
|
|
set_target_properties(GameModule PROPERTIES
|
|
PREFIX "lib"
|
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
|
)
|
|
|
|
# ============================================================================
|
|
# Copy config files to build directory
|
|
# ============================================================================
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/config/
|
|
DESTINATION ${CMAKE_BINARY_DIR}/config)
|
|
|
|
# ============================================================================
|
|
# Development targets
|
|
# ============================================================================
|
|
|
|
# Quick rebuild of modules only (for hot-reload workflow)
|
|
add_custom_target(modules
|
|
DEPENDS GameModule
|
|
COMMENT "Building hot-reloadable modules only"
|
|
)
|
|
|
|
# Run MobileCommand
|
|
add_custom_target(run
|
|
COMMAND $<TARGET_FILE:mobilecommand>
|
|
DEPENDS mobilecommand modules
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
COMMENT "Running Mobile Command"
|
|
)
|