From db91fa84a71958796a013c4392ea7b3b558df680 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 11 Nov 2024 14:21:40 -0800 Subject: [PATCH] Added GitHub Action for UWP builds (#148) --- .github/workflows/main.yml | 24 +++++++++++---- .github/workflows/uwp.yml | 63 ++++++++++++++++++++++++++++++++++++++ CMakePresets.json | 50 ++++++++++++++++++++---------- 3 files changed, 114 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/uwp.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3520d4..7042d19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,12 +39,6 @@ jobs: - os: windows-2022 build_type: x86-Release arch: amd64_x86 - - os: windows-2022 - build_type: x64-Debug-Clang - arch: amd64 - - os: windows-2022 - build_type: x64-Release-Clang - arch: amd64 - os: windows-2022 build_type: arm64-Debug arch: amd64_arm64 @@ -57,6 +51,24 @@ jobs: - os: windows-2022 build_type: arm64ec-Release arch: amd64_arm64 + - os: windows-2022 + build_type: x64-Debug-Clang + arch: amd64 + - os: windows-2022 + build_type: x64-Release-Clang + arch: amd64 + - os: windows-2022 + build_type: x86-Debug-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Release-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: arm64-Debug-Clang + arch: amd64_arm64 + - os: windows-2022 + build_type: arm64-Release-Clang + arch: amd64_arm64 - os: windows-2022 build_type: x64-Debug-MinGW arch: amd64 diff --git a/.github/workflows/uwp.yml b/.github/workflows/uwp.yml new file mode 100644 index 0000000..4437799 --- /dev/null +++ b/.github/workflows/uwp.yml @@ -0,0 +1,63 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +name: 'CMake (UWP)' + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + +permissions: + contents: read + +jobs: + build: + runs-on: windows-2022 + + strategy: + fail-fast: false + + matrix: + build_type: [x64-Debug-UWP, x64-Release-UWP, x64-Debug-UWP-Clang, x64-Release-UWP-Clang] + arch: [amd64] + include: + - build_type: x86-Debug-UWP + arch: amd64_x86 + - build_type: x86-Release-UWP + arch: amd64_x86 + - build_type: x86-Debug-UWP-Clang + arch: amd64_x86 + - build_type: x86-Release-UWP-Clang + arch: amd64_x86 + - build_type: arm64-Debug-UWP + arch: amd64_arm64 + - build_type: arm64-Release-UWP + arch: amd64_arm64 + - build_type: arm64-Debug-UWP-Clang + arch: amd64_arm64 + - build_type: arm64-Release-UWP-Clang + arch: amd64_arm64 + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: 'Install Ninja' + run: choco install ninja + + - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + with: + arch: ${{ matrix.arch }} + uwp: true + + - name: 'Configure CMake' + working-directory: ${{ github.workspace }} + run: cmake --preset=${{ matrix.build_type }} + + - name: 'Build' + working-directory: ${{ github.workspace }} + run: cmake --build out\build\${{ matrix.build_type }} diff --git a/CMakePresets.json b/CMakePresets.json index 6b8b588..12ca91f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -27,15 +27,6 @@ }, "hidden": true }, - { - "name": "ARM", - "architecture": { - "value": "arm", - "strategy": "external" - }, - - "hidden": true - }, { "name": "ARM64", "architecture": { @@ -50,6 +41,10 @@ "value": "arm64ec", "strategy": "external" }, + "environment": { + "CFLAGS": "/arm64EC", + "CXXFLAGS": "/arm64EC" + }, "hidden": true }, @@ -88,6 +83,22 @@ "strategy": "external" } }, + { + "name": "Clang-X86", + "environment": { + "CFLAGS": "-m32", + "CXXFLAGS": "-m32" + }, + "hidden": true + }, + { + "name": "Clang-AArch64", + "environment": { + "CFLAGS": "--target=arm64-pc-windows-msvc", + "CXXFLAGS": "--target=arm64-pc-windows-msvc" + }, + "hidden": true + }, { "name": "GNUC", "hidden": true, @@ -150,24 +161,29 @@ { "name": "x86-Release" , "description": "MSVC for x86 (Release)", "inherits": [ "base", "x86", "Release", "MSVC" ] }, { "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] }, { "name": "arm64-Release" , "description": "MSVC for ARM64 (Release)", "inherits": [ "base", "ARM64", "Release", "MSVC" ] }, - { "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug)", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ], "environment": { "CFLAGS": "/arm64EC", "CXXFLAGS": "/arm64EC" } }, - { "name": "arm64ec-Release" , "description": "MSVC for ARM64EC (Release)", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ], "environment": { "CFLAGS": "/arm64EC", "CXXFLAGS": "/arm64EC" } }, + { "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug)", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ] }, + { "name": "arm64ec-Release" , "description": "MSVC for ARM64EC (Release)", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ] }, { "name": "x64-Debug-UWP" , "description": "MSVC for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "MSVC", "UWP" ] }, { "name": "x64-Release-UWP" , "description": "MSVC for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "MSVC", "UWP" ] }, { "name": "x86-Debug-UWP" , "description": "MSVC for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "MSVC", "UWP" ] }, { "name": "x86-Release-UWP" , "description": "MSVC for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "MSVC", "UWP" ] }, - { "name": "arm-Debug-UWP" , "description": "MSVC for ARM (Debug) for UWP", "inherits": [ "base", "ARM", "Debug", "MSVC", "UWP" ] }, - { "name": "arm-Release-UWP" , "description": "MSVC for ARM (Release) for UWP", "inherits": [ "base", "ARM", "Release", "MSVC", "UWP" ] }, { "name": "arm64-Debug-UWP" , "description": "MSVC for ARM64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "MSVC", "UWP" ] }, { "name": "arm64-Release-UWP", "description": "MSVC for ARM64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "MSVC", "UWP" ] }, { "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "Clang" ] }, { "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release)", "inherits": [ "base", "x64", "Release", "Clang" ] }, - { "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, - { "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, - { "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, - { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, + { "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86" ] }, + { "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86" ] }, + { "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64" ] }, + { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64" ] }, + + { "name": "x64-Debug-UWP-Clang" , "description": "Clang/LLVM for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "Clang", "UWP" ] }, + { "name": "x64-Release-UWP-Clang" , "description": "Clang/LLVM for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "Clang", "UWP" ] }, + { "name": "x86-Debug-UWP-Clang" , "description": "Clang/LLVM for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "UWP" ] }, + { "name": "x86-Release-UWP-Clang" , "description": "Clang/LLVM for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "UWP" ] }, + { "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64", "UWP" ] }, + { "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64", "UWP" ] }, { "name": "x64-Debug-ICC" , "description": "Intel Classic Compiler (Debug)", "inherits": [ "base", "x64", "Debug", "Intel" ] }, { "name": "x64-Release-ICC" , "description": "Intel Classic Compiler (Release)", "inherits": [ "base", "x64", "Release", "Intel" ] },