Files
AIGame/AIServer/CMakeLists.txt
T
udxandCursor c94b8fefeb Add MainHUD gameplay UI, net handshake updates, and server maintenance mode.
Introduce UiManager/MainHUD prefab flow, strengthen GameNet/WsClient, and add AIServer maintenance endpoint support.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 17:34:42 +08:00

44 lines
1.1 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
cmake_minimum_required(VERSION 3.20)
project(AIServer LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(aiserver
src/main.cpp
src/db.cpp
src/auth.cpp
src/http_ws_server.cpp
src/maintenance.cpp
src/crypto.cpp
third_party/sqlite3.c
)
target_include_directories(aiserver PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/third_party
)
# SQLite: 关闭部分扩展,加快编译
target_compile_definitions(aiserver PRIVATE
SQLITE_OMIT_LOAD_EXTENSION
SQLITE_THREADSAFE=1
_CRT_SECURE_NO_WARNINGS
)
if(WIN32)
target_link_libraries(aiserver PRIVATE ws2_32 bcrypt)
# sqlite3.c 是 C,MSVC 下关闭部分告警
if(MSVC)
target_compile_options(aiserver PRIVATE /W3 /utf-8)
set_source_files_properties(third_party/sqlite3.c PROPERTIES COMPILE_FLAGS "/W0")
endif()
else()
target_link_libraries(aiserver PRIVATE pthread dl)
endif()
# 运行时默认数据目录:可执行文件旁的 data/
add_custom_command(TARGET aiserver POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:aiserver>/data
)