Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Mar 27, 2024
1 parent 0132625 commit 89bafd4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
12 changes: 11 additions & 1 deletion doc/docs/introduction/how-to-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ ctest
| PHOTON_ENABLE_FSTACK_DPDK | OFF | Enable F-Stack and DPDK. Requires both. |
| PHOTON_ENABLE_EXTFS | OFF | Enable extfs. Requires `libe2fs` |

#### Example
#### Case 1. Staitcally build all third-party libs

Build all the dependencies from source, so you can distribute Photon binary anywhere, as long as libc and libc++ versions suffice.

Expand All @@ -194,3 +194,13 @@ cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D PHOTON_GFLAGS_SOURCE=https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz \
-D PHOTON_GOOGLETEST_SOURCE=https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz
```

#### Case 2. Dynamically link to libcurl.so and libssl.so

```bash
cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D PHOTON_BUILD_DEPENDENCIES=ON \
-D PHOTON_AIO_SOURCE=https://pagure.io/libaio/archive/libaio-0.3.113/libaio-0.3.113.tar.gz \
-D PHOTON_CURL_SOURCE="" \
-D PHOTON_OPENSSL_SOURCE=""
```
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ ctest
| PHOTON_ENABLE_FSTACK_DPDK | OFF | 开启 F-Stack and DPDK,需要两者的库 |
| PHOTON_ENABLE_EXTFS | OFF | 开启 extfs. 需要 `libe2fs` |

#### 例子
#### 例子1

用源码编译所有依赖,这样你就可以随意分发Photon二进制了,只要运行机器上的libc和libc++的版本满足条件。

Expand All @@ -194,3 +194,15 @@ cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D PHOTON_GFLAGS_SOURCE=https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz \
-D PHOTON_GOOGLETEST_SOURCE=https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz
```

#### 例子2

动态依赖 libcurl.so 和 libssl.so,libaio 源码编译

```bash
cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D PHOTON_BUILD_DEPENDENCIES=ON \
-D PHOTON_AIO_SOURCE=https://pagure.io/libaio/archive/libaio-0.3.113/libaio-0.3.113.tar.gz \
-D PHOTON_CURL_SOURCE="" \
-D PHOTON_OPENSSL_SOURCE=""
```

0 comments on commit 89bafd4

Please sign in to comment.