From 6b2d046548ca3a9ff64379271c05902c1cebe790 Mon Sep 17 00:00:00 2001 From: xfy911 Date: Wed, 3 Jun 2026 17:46:37 +0800 Subject: [PATCH] =?UTF-8?q?chore(submodule):=20coco=20=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=20git=20submodule=EF=BC=8C=E6=9B=B4=E6=96=B0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 coco 作为 git submodule 引入(xfy911/coco fork) - Makefile: 默认路径改为 coco/(submodule 目录),支持 COCO_DIR 覆盖 - Makefile: 新增 deps / build-all 目标,自动构建 coco 依赖 - README: 更新构建说明,添加 --recursive clone 和 submodule 初始化步骤 --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5b508e5..a0cbac2 100644 --- a/README.md +++ b/README.md @@ -24,20 +24,28 @@ ### 依赖 - GCC / Clang(C11 标准) -- [coco](https://github.com/DefectingCat/coco) 协程库(已编译) +- [coco](https://github.com/xfy911/coco) 协程库(通过 git submodule 自动获取) - Linux(内核 ≥ 5.1,支持 io_uring)/ macOS +- CMake 3.10+(用于构建 coco 依赖) ### 构建 ```bash -git clone https://github.com/xfy911/cocoon.git +git clone --recursive https://github.com/xfy911/cocoon.git cd cocoon -# 默认使用 ../coco 作为 coco 库路径 -make +# 如果 clone 时忘了 --recursive,补初始化 submodule +git submodule update --init --recursive -# 或指定路径 -make COCO_INCLUDE=/path/to/coco/include COCO_LIB=/path/to/coco/build +# 构建 cocoon(会自动检测并构建 coco 依赖) +make build-all + +# 或者分开构建 +make deps # 先构建 coco +make # 再构建 cocoon + +# 也可以使用系统上已有的 coco +make COCO_DIR=/path/to/coco ``` ### 运行