From 26d096e8f0f46111e6696d9db7e47e70049b13c0 Mon Sep 17 00:00:00 2001 From: IronsDu Date: Thu, 9 Apr 2026 15:40:35 +0800 Subject: [PATCH 1/2] docs: improve build/install sections and add CMake options documentation - README: add CMake options table, build type explanations, common build scenarios, and install instructions with file layout - 05_installation.md: rewrite to remove fictional content (Conan, system package managers) and keep only actually available methods (source build, FetchContent, add_subdirectory) with correct examples from cmake/examples/ Co-Authored-By: Claude Opus 4.6 --- README.md | 111 ++++++ docs/user_guide/05_installation.md | 611 +++++++++-------------------- 2 files changed, 299 insertions(+), 423 deletions(-) diff --git a/README.md b/README.md index 4fb0e4f..83a7fbb 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ - [功能特性](#-功能特性) - [设计理念](#-设计理念) - [快速开始](#-快速开始) +- [CMake 构建选项](#-cmake-构建选项) +- [安装](#-安装) - [使用方法](#-使用方法) - [如何查看火焰图](#-如何查看火焰图) - [API 端点](#-api-端点) @@ -171,6 +173,115 @@ cmake .. \ make -j$(nproc) ``` +**构建类型说明**(`CMAKE_BUILD_TYPE`): + +| 构建类型 | 说明 | +|---------|------| +| `Release` | 优化编译(`-O2`),适合生产使用 | +| `Debug` | 无优化(`-O0`),适合调试 | +| `RelWithDebInfo` | 优化编译且包含调试符号(**默认**),推荐用于 profiling | + +> 所有构建类型默认包含 `-g` 调试符号,以确保 profiling 结果能正确显示函数名。 + +## ⚙️ CMake 构建选项 + +项目提供以下 CMake 选项,可通过 `-D