Adapt Android mobile controls and native client UI
This commit is contained in:
+17
-50
@@ -1,62 +1,38 @@
|
||||
# mtgodot-poc — top level
|
||||
# Phase 1 (macOS) scaffolding. See docs/GODOT-POC-PLAN.md §M0'.
|
||||
#
|
||||
# libgr2 / formats / oracle / tools were vendored in from the retired xrender-poc
|
||||
# repo (2026-08-29). libgr2 is the shared core (gr2 v6/v7 reader, oracle-verified);
|
||||
# formats = .msa/.msm parsers (needed M2 T2.2/T2.3); tools = libgr2 validation.
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(mtgodot_poc CXX C)
|
||||
project(metin2_native CXX C)
|
||||
|
||||
include(CTest)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
option(MT_BUILD_TOOLS "Build libgr2 validation tools" OFF)
|
||||
option(MT_BUILD_NET_TOOLS "Build the host-only classic protocol probe" OFF)
|
||||
option(MT_BUILD_PORT "Build the 40250 port and its tests" ON)
|
||||
option(MT_BUILD_NATIVE_RENDER "Build the SDL3 and Vulkan client" OFF)
|
||||
|
||||
option(MTGODOT_BUILD_EXTENSION "Build the Godot GDExtension (pulls in godot-cpp)" ON)
|
||||
option(MTGODOT_BUILD_TOOLS "Build libgr2 validation tools (gr2dump/gr2fuzz/oracle_diff)" OFF)
|
||||
option(MTGODOT_BUILD_NET_TOOLS "Build host-only protocol probes without Godot" OFF)
|
||||
option(MTGODOT_BUILD_PORT "Build only port_logic (with MTGODOT_BUILD_EXTENSION=OFF), e.g. for Linux/Windows" OFF)
|
||||
option(MT_BUILD_NATIVE_RENDER_PROTOTYPE "Build the standalone Vulkan draw-command prototype" OFF)
|
||||
|
||||
# --- shared, cross-platform core (no godot-cpp, no third-party) ---
|
||||
add_subdirectory(libgr2)
|
||||
add_subdirectory(formats)
|
||||
add_subdirectory(extension/third_party)
|
||||
add_subdirectory(extension/src/codepage)
|
||||
if(MT_BUILD_PORT OR MT_BUILD_NATIVE_RENDER)
|
||||
add_subdirectory(extension/src/port)
|
||||
endif()
|
||||
|
||||
if(MTGODOT_BUILD_TOOLS)
|
||||
if(MT_BUILD_TOOLS)
|
||||
add_subdirectory(tools)
|
||||
endif()
|
||||
|
||||
# --- the Godot extension ---
|
||||
# Phase 1 was macOS-only; Phase 2 (BACKLOG F1/F2) adds iOS + Android. The three
|
||||
# native deps are vendored (extension/third_party), so the only gate now is
|
||||
# "is this a platform we've wired output naming + a toolchain for".
|
||||
if(MTGODOT_BUILD_EXTENSION)
|
||||
set(_mt_plat "${CMAKE_SYSTEM_NAME}")
|
||||
if(_mt_plat STREQUAL "Darwin" OR _mt_plat STREQUAL "iOS" OR _mt_plat STREQUAL "Android")
|
||||
message(STATUS "mtgodot extension: building for ${_mt_plat}")
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"MTGODOT_BUILD_EXTENSION: supported targets are macOS / iOS / Android "
|
||||
"(got CMAKE_SYSTEM_NAME='${_mt_plat}'). See docs/PLATFORMS.md. "
|
||||
"Use -DMTGODOT_BUILD_EXTENSION=OFF to build just libgr2/formats/tools.")
|
||||
endif()
|
||||
add_subdirectory(extension)
|
||||
endif()
|
||||
|
||||
# FreeBSD is the native build target of the archived 40250 server, but it is
|
||||
# not a supported Godot extension target. Keep the live classic probe
|
||||
# available as a small host-only build so a FreeBSD jail/VM can compile and run
|
||||
# it without pulling in godot-cpp or the Darwin/iOS/Android extension.
|
||||
if(MTGODOT_BUILD_NET_TOOLS AND NOT MTGODOT_BUILD_EXTENSION)
|
||||
add_subdirectory(extension/third_party)
|
||||
# The protocol probe remains useful on the archived server's FreeBSD host.
|
||||
if(MT_BUILD_NET_TOOLS)
|
||||
add_library(mtnet_host STATIC
|
||||
extension/src/net/text_codec.cpp
|
||||
extension/src/net/secure_cipher.cpp
|
||||
extension/src/net/net_stream.cpp
|
||||
extension/src/net/entity_store.cpp
|
||||
@@ -67,22 +43,13 @@ if(MTGODOT_BUILD_NET_TOOLS AND NOT MTGODOT_BUILD_EXTENSION)
|
||||
extension/src/net/classic/classic_cipher.cpp
|
||||
)
|
||||
target_include_directories(mtnet_host PUBLIC extension/src/net)
|
||||
target_link_libraries(mtnet_host PUBLIC mt3p::sodium mt3p::minilzo mt3p::cryptopp)
|
||||
target_link_libraries(mtnet_host PUBLIC mt3p::sodium mt3p::minilzo mt3p::cryptopp mt_codepage)
|
||||
target_compile_features(mtnet_host PUBLIC cxx_std_20)
|
||||
|
||||
add_executable(net_classic_e2e_host extension/tools/net_classic_e2e.cpp)
|
||||
target_link_libraries(net_classic_e2e_host PRIVATE mtnet_host)
|
||||
endif()
|
||||
|
||||
# port_logic has no Godot dependency. On targets without an extension build (Linux, Windows) it is
|
||||
# built on its own so the 2A gate (header self-containment, static_asserts) runs per platform.
|
||||
if(MTGODOT_BUILD_PORT AND NOT MTGODOT_BUILD_EXTENSION)
|
||||
if(NOT TARGET mt3p::cryptopp)
|
||||
add_subdirectory(extension/third_party)
|
||||
endif()
|
||||
add_subdirectory(extension/src/port)
|
||||
endif()
|
||||
|
||||
if(MT_BUILD_NATIVE_RENDER_PROTOTYPE)
|
||||
if(MT_BUILD_NATIVE_RENDER)
|
||||
add_subdirectory(native_render)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user