Updated workflow file to fix wrong CMake detection of MSVC #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: windows-builds | |
| # Trigger this workflow on any push or manual dispatch | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| build_windows_msvc_ninja: | |
| name: Build with MSVC + Ninja | |
| runs-on: windows-2022 | |
| env: | |
| QT_VERSION: 6.4.2 | |
| QT_DIR: ${{ github.workspace }}\Qt # Directory where Qt will be installed | |
| steps: | |
| - name: 📦 Checkout source code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch full git history and tags | |
| - name: 📥 Install Qt for MSVC | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: ${{ env.QT_VERSION }} # Qt version to install | |
| target: desktop # Desktop Qt build | |
| host: windows # Host OS | |
| arch: win64_msvc2019_64 # MSVC 2019 64-bit architecture | |
| dir: ${{ env.QT_DIR }} # Install path for Qt | |
| setup-python: false # Skip Python setup (optional) | |
| - name: ⚙️ Install Ninja build system | |
| run: choco install ninja --no-progress # Install Ninja via Chocolatey | |
| shell: powershell | |
| - name: 🛠️ Configure CMake (Ninja + MSVC) | |
| # Use windows-msvc shell that auto-sets MSVC environment variables | |
| shell: windows-msvc | |
| run: | | |
| cmake -S . -B build ` | |
| -G Ninja ` # Use Ninja generator | |
| -A x64 ` # Target 64-bit architecture | |
| -DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\msvc2019_64" ` # Qt install path for CMake | |
| -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\install" ` # Install path | |
| -DCMAKE_BUILD_TYPE=Release # Release build type | |
| - name: 🔨 Build with Ninja + MSVC | |
| shell: windows-msvc | |
| run: cmake --build build # Build the project | |
| - name: 📦 Install built files | |
| shell: windows-msvc | |
| run: cmake --install build # Install the build output | |
| build_windows_mingw: | |
| name: Build with MinGW + Ninja | |
| runs-on: windows-2022 | |
| env: | |
| QT_VERSION: 6.4.2 | |
| QT_DIR: ${{ github.workspace }}\Qt # Directory where Qt will be installed | |
| steps: | |
| - name: 📦 Checkout source code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Full history for tags/versions if needed | |
| - name: ⚙️ Install Ninja and MinGW toolchain | |
| run: | | |
| choco inst |