Skip to content

Commit

Permalink
Add MSVC support
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeLepape committed Jan 3, 2024
1 parent 24e6d94 commit dae1d30
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest]
compiler: [Clang, GCC]
compiler: [Clang, GCC, MSVC]
build_type: [Debug, Release]
exclude:
- os: windows-latest
compiler: GCC
- compiler: Clang
- os: ubuntu-latest
compiler: MSVC

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.21)

# set the project name
project(Elevation)

Check failure on line 4 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / build (windows-latest, MSVC, Debug)

Generator

Check failure on line 4 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / build (windows-latest, MSVC, Release)

Generator
Expand Down
45 changes: 44 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"version": 2,
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "GCC-Debug",
Expand Down Expand Up @@ -56,6 +61,44 @@
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "MSVC-Debug",
"displayName": "Build with MSVC in debug mode",
"generator": "Visual Studio 16 2019",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_COMPILER": "cl++",
"CMAKE_C_COMPILER": "cl",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "MSVC-Release",
"displayName": "Build with MSVC in release mode",
"generator": "Visual Studio 16 2019",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_COMPILER": "cl++",
"CMAKE_C_COMPILER": "cl",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
]
}

0 comments on commit dae1d30

Please sign in to comment.