Skip to content

Commit

Permalink
update window install
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq committed Jan 6, 2024
1 parent 400f8d6 commit 311a9a5
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
29 changes: 27 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ Ubuntu>= 20.04 , test on Fedora38 需要按装asan(sudo yum install libasan)
- 环境配置
[paozhu 框架linux 环境配置](https://github.com/hggq/paozhu/wiki/linux-%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE)

#### 3.3 Windows
#### 3.3 Windows

安装xmake
支持vcpkg和xmake

xmake安装

在项目根目录 执行
配置 `conf/server.conf` 替换 /Users/hzq/paozhu 为你的项目目录
Expand All @@ -89,6 +91,29 @@ paozhu-main> xmake
paozhu-main> .\build\windows\x64\release\paozhu.exe
```

vcpkg安装

```
Invoke-WebRequest -OutFile vcpkg2023.zip https://github.com/microsoft/vcpkg/archive/refs/tags/2023.12.12.zip
unzip vcpkg2023.zip
cd vcpkg-2023.12.12
bootstrap-vcpkg.bat
vcpkg integrate install
vcpkg integrate project
vcpkg install
```

安装 ninja https://github.com/ninja-build/ninja/releases

编译项目 注意`CMAKE_TOOLCHAIN_FILE`指定vcpkg位置

```
unzip asio.zip
cmake . -B ${{github.workspace}} -DENABLE_WIN_VCPKG=ON -DENABLE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg-2023.12.12/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -G Ninja
cmake --build . --config Debug
```


### 4.安装方法

下载新版asio到项目根目录
Expand Down
29 changes: 28 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,41 @@ Ubuntu>= 20.04 , test on Fedora38, need install asan(sudo yum install libasan

#### 3.3 Windows

- Install xmake

Supports install methods vcpkg and xmake

- xmake install
Execute at the root directory of the project
Config `conf/server.conf` replace /Users/hzq/paozhu path to your project path
```
paozhu-main> xmake
paozhu-main> .\build\windows\x64\release\paozhu.exe
```

- vcpkg install

```
Invoke-WebRequest -OutFile vcpkg2023.zip https://github.com/microsoft/vcpkg/archive/refs/tags/2023.12.12.zip
unzip vcpkg2023.zip
cd vcpkg-2023.12.12
bootstrap-vcpkg.bat
vcpkg integrate install
vcpkg integrate project
vcpkg install
```

Install ninja https://github.com/ninja-build/ninja/releases

Compile project `CMAKE_TOOLCHAIN_FILE` is vcpkg install localtion path

```
unzip asio.zip
cmake . -B ${{github.workspace}} -DENABLE_WIN_VCPKG=ON -DENABLE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg-2023.12.12/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -G Ninja
cmake --build . --config Debug
```



### 4.Install

Download asio new version to project root part
Expand Down
4 changes: 2 additions & 2 deletions controller/src/techempower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ std::string techempowerdb(std::shared_ptr<httppeer> peer)
{
peer->type("application/json; charset=UTF-8");
peer->set_header("Date", get_gmttime());
unsigned int rd_num = rand_range(1, 10000);
auto myworld = orm::World();
unsigned int rd_num = rand_range(1, 10000);
myworld.where("id", rd_num).fetch();

peer->output = myworld.data_tojson();
Expand All @@ -61,8 +61,8 @@ std::string techempowerqueries(std::shared_ptr<httppeer> peer)
auto myworld = orm::World();
for (unsigned int i = 0; i < get_num; i++)
{
unsigned int rd_num = rand_range(1, 10000);
myworld.wheresql.clear();
unsigned int rd_num = rand_range(1, 10000);
myworld.where("id", rd_num).fetch_append();
}

Expand Down

0 comments on commit 311a9a5

Please sign in to comment.