Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds AppleClang + msvc preset #82

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
25 changes: 21 additions & 4 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,37 @@ on:

jobs:
preset-test:
runs-on: ubuntu-latest
strategy:
matrix:
preset: ["gcc-debug", "gcc-release"]
name: "Preset: ${{ matrix.preset }}"
presets:
- preset: "gcc-debug"
platform: "ubuntu-latest"
- preset: "gcc-release"
platform: "ubuntu-latest"
- preset: "AppleClang-debug"
platform: "macos-latest"
- preset: "AppleClang-release"
platform: "macos-latest"
- preset: "msvc-debug"
platform: "windows-latest"
- preset: "msvc-release"
platform: "windows-latest"
name: "Preset: ${{ matrix.presets.preset }} on ${{ matrix.presets.platform }}"
runs-on: ${{ matrix.presets.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup build environment
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
ninjaVersion: "^1.11.1"
- name: Setup MSVC
if: startsWith(matrix.presets.platform, 'windows')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
- name: Run preset
run: cmake --workflow --preset ${{ matrix.preset }}
run: cmake --workflow --preset ${{ matrix.presets.preset }}

gtest-test:
strategy:
Expand Down
165 changes: 159 additions & 6 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
"name": "_debug-base",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "_release-base",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS": "-O3"
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
Expand All @@ -34,7 +32,8 @@
"_debug-base"
],
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++"
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
}
},
{
Expand All @@ -45,7 +44,57 @@
"_release-base"
],
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++"
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_CXX_FLAGS": "-O3"
}
},
{
"name": "AppleClang-debug",
"displayName": "xcode Debug Build",
"inherits": [
"_root-config",
"_debug-base"
],
"cacheVariables": {
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined"
}
},
{
"name": "AppleClang-release",
"displayName": "xcode Release Build",
"inherits": [
"_root-config",
"_release-base"
],
"cacheVariables": {
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS": "-O3"
}
},
{
"name": "msvc-debug",
"displayName": "MSVC Debug Build",
"inherits": [
"_root-config",
"_debug-base"
],
"cacheVariables": {
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_BUILD_TYPE": "Debug",
wusatosi marked this conversation as resolved.
Show resolved Hide resolved
"CMAKE_CXX_FLAGS": "/EHsc /permissive- /fsanitize=address /Zi"
}
},
{
"name": "msvc-release",
"displayName": "MSVC Release Build",
"inherits": [
"_root-config",
"_release-base"
],
"cacheVariables": {
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_CXX_FLAGS": "/EHsc /permissive- /O2"
}
}
],
Expand All @@ -57,6 +106,22 @@
{
"name": "gcc-release",
"configurePreset": "gcc-release"
},
{
"name": "AppleClang-debug",
"configurePreset": "AppleClang-debug"
},
{
"name": "AppleClang-release",
"configurePreset": "AppleClang-release"
},
{
"name": "msvc-debug",
"configurePreset": "msvc-debug"
},
{
"name": "msvc-release",
"configurePreset": "msvc-release"
}
],
"testPresets": [
Expand All @@ -80,6 +145,26 @@
"name": "gcc-release",
"inherits": "_test_base",
"configurePreset": "gcc-release"
},
{
"name": "AppleClang-debug",
"inherits": "_test_base",
"configurePreset": "AppleClang-debug"
},
{
"name": "AppleClang-release",
"inherits": "_test_base",
"configurePreset": "AppleClang-release"
},
{
"name": "msvc-debug",
"inherits": "_test_base",
"configurePreset": "msvc-debug"
},
{
"name": "msvc-release",
"inherits": "_test_base",
"configurePreset": "msvc-release"
}
],
"workflowPresets": [
Expand Down Expand Up @@ -116,6 +201,74 @@
"name": "gcc-release"
}
]
},
{
"name": "AppleClang-debug",
"steps": [
{
"type": "configure",
"name": "AppleClang-debug"
},
{
"type": "build",
"name": "AppleClang-debug"
},
{
"type": "test",
"name": "AppleClang-debug"
}
]
},
{
"name": "AppleClang-release",
"steps": [
{
"type": "configure",
"name": "AppleClang-release"
},
{
"type": "build",
"name": "AppleClang-release"
},
{
"type": "test",
"name": "AppleClang-release"
}
]
},
{
"name": "msvc-debug",
"steps": [
{
"type": "configure",
"name": "msvc-debug"
},
{
"type": "build",
"name": "msvc-debug"
},
{
"type": "test",
"name": "msvc-debug"
}
]
},
{
"name": "msvc-release",
"steps": [
{
"type": "configure",
"name": "msvc-release"
},
{
"type": "build",
"name": "msvc-release"
},
{
"type": "test",
"name": "msvc-release"
}
]
}
]
}
Loading