From fedef3dd1dbf75946c4f507a615ca17a170121c0 Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Fri, 6 Feb 2026 13:09:48 +0800 Subject: [PATCH] build: add glm library --- CMakeLists.txt | 2 ++ README.md | 1 - cmake/ThirdParty.cmake | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd21651..5e3ecd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,7 @@ if (WIN32) SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image nlohmann_json::nlohmann_json + glm::glm ws2_32 mswsock advapi32 @@ -107,6 +108,7 @@ else() # Linux/macOS 等 Unix-like 系统 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image nlohmann_json::nlohmann_json + glm::glm pthread # Linux 需要 pthread ${CMAKE_DL_LIBS} # 动态链接库 ) diff --git a/README.md b/README.md index 1b8a4af..11ed647 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ ninja - 完善网络对战结束处理 - 整改输入和事件分发系统 -- 添加glm库,改用vec2记录二维坐标 ## 待添加玩法 diff --git a/cmake/ThirdParty.cmake b/cmake/ThirdParty.cmake index c196ff7..12028e3 100644 --- a/cmake/ThirdParty.cmake +++ b/cmake/ThirdParty.cmake @@ -13,4 +13,13 @@ FetchContent_Declare( GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git GIT_TAG asio-1-36-0 # 指定一个稳定版本标签 ) -FetchContent_MakeAvailable(asio) \ No newline at end of file +FetchContent_MakeAvailable(asio) + +FetchContent_Declare( + glm + GIT_REPOSITORY https://github.com/g-truc/glm.git + GIT_TAG 1.0.3 # 使用稳定版本 + # 或者使用最新的稳定版本标签,例如: + # GIT_TAG 1.0.1 # 请查看glm的发布页面获取最新稳定版本 +) +FetchContent_MakeAvailable(glm) \ No newline at end of file