Windows CMake preset: use ninja generator

This commit is contained in:
Louis Gombert 2024-06-05 19:37:00 +02:00
parent fd61549080
commit 82c04f8fb9
3 changed files with 29 additions and 8 deletions

View File

@ -16,7 +16,7 @@ on:
jobs:
build:
name: ${{ matrix.os.runner }}, ${{ matrix.os.cxx }}, ${{ matrix.build_type }}
name: ${{ matrix.os.name }}, ${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
@ -73,6 +73,15 @@ jobs:
sudo apt install -y --no-install-recommends \
ninja-build cmake g++ libgtest-dev libsdl2-dev zlib1g-dev libspdlog-dev
- name: Install Windows dependencies
if: ${{ matrix.os.runner == 'windows-latest' }}
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os.runner == 'windows-latest' }}
with:
arch: ${{ matrix.os.preset }}
- name: Configure CMake
env:
CC: ${{ matrix.os.cc }}

View File

@ -9,25 +9,37 @@
{
"name": "win32",
"inherits": "defaults",
"generator": "Visual Studio 17 2022",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"architecture": "Win32",
"architecture": {
"strategy": "external",
"value": "x86"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-windows"
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "win64",
"inherits": "defaults",
"generator": "Visual Studio 17 2022",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"architecture": "x64",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows"
},
"architecture": {
"strategy": "external",
"value": "x64"
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{

View File

@ -105,10 +105,10 @@ setx VCPKG_ROOT="C:\path\to\vcpkg"
setx PATH=%VCPKG_ROOT%;%PATH%
```
Build Descent 3:
Build Descent 3 using the "x86 native tools command prompt"
```sh
cmake --preset win -D ENABLE_LOGGER=[ON|OFF]
cmake --build --preset win --config [Debug|Release]
cmake --preset win32 -D ENABLE_LOGGER=[ON|OFF]
cmake --build --preset win32 --config [Debug|Release]
```
#### Building - MacOS