fix: MSVC need config option

This commit is contained in:
TaurusXin 2024-02-08 10:49:07 +08:00
parent 0f8158c964
commit 1cfc29560d
Signed by: taurusxin
GPG Key ID: C334DCA04AC2D2CC
2 changed files with 6 additions and 2 deletions

View File

@ -48,7 +48,7 @@ jobs:
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }}
- name: Build
run: cmake --build ${{ env.BUILD_PATH }} -j 4
run: cmake --build ${{ env.BUILD_PATH }} -j 4 --config ${{ env.BUILD_TYPE }}
- name: Upload artifact
uses: actions/upload-artifact@v4

View File

@ -63,7 +63,7 @@ git submodule update --init --recursive
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -B build
# Windows MSVC
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -B build --config Release
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -B build
# Linux / macOS
cmake -DCMAKE_BUILD_TYPE=Release -B build
@ -72,5 +72,9 @@ cmake -DCMAKE_BUILD_TYPE=Release -B build
编译项目
```shell
# Windows MSVC 需要在构建阶段指定 --config Release
cmake --build build --target all -j 8 --config Release
# Windows MinGW / Linux / macOS
cmake --build build --target all -j 8
```