File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -106,3 +106,53 @@ int main() {
106106
107107在下一章节,我们将深入探讨 ` Task ` 的更多用法。
108108
109+ ## 4. 下载方式
110+
111+ 你可以通过以下方式获取 ` koroutine_lib ` :
112+
113+ - ** GitHub Releases (推荐)** : 下载预编译好的库文件和头文件。
114+ [ 前往下载页面 :arrow_right : ] ( https://github.com/King-sj/koroutine_lib/releases )
115+
116+ - ** 源码克隆** :
117+ ``` bash
118+ git clone https://github.com/King-sj/koroutine_lib.git
119+ ```
120+
121+ ## 5. 其他集成方案
122+
123+ 除了使用预编译包,你也可以选择以下方式集成:
124+
125+ ### 源码集成 (add_subdirectory)
126+
127+ 如果你希望将 ` koroutine_lib ` 作为子项目编译:
128+
129+ 1 . 将仓库作为子模块添加到你的项目中:
130+ ``` bash
131+ git submodule add https://github.com/King-sj/koroutine_lib.git third_party/koroutine_lib
132+ ```
133+
134+ 2. 在 ` CMakeLists.txt` 中添加:
135+ ` ` ` cmake
136+ add_subdirectory(third_party/koroutine_lib)
137+ target_link_libraries(my_app PRIVATE koroutinelib)
138+ ` ` `
139+
140+ # ## FetchContent (CMake 3.11+)
141+
142+ 使用 CMake 的 ` FetchContent` 模块自动下载并集成:
143+
144+ ` ` ` cmake
145+ include(FetchContent)
146+
147+ FetchContent_Declare(
148+ koroutine_lib
149+ GIT_REPOSITORY https://github.com/King-sj/koroutine_lib.git
150+ GIT_TAG main # 建议指定具体的 tag 或 commit hash
151+ )
152+
153+ FetchContent_MakeAvailable(koroutine_lib)
154+
155+ target_link_libraries(my_app PRIVATE koroutinelib)
156+ ` ` `
157+
158+
You can’t perform that action at this time.
0 commit comments