Skip to content

Commit

Permalink
Set up build action
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba160 committed Jan 13, 2024
1 parent 0268ddd commit 5e6267d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: libdispatch Windows clang

on: [push]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
C_COMPILER: clang
CPP_COMPILER: clang++

jobs:
build:
Expand All @@ -16,18 +15,18 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: ilammy/[email protected]

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{env.CPP_COMPILER}} -DCMAKE_C_COMPILER=${{env.C_COMPILER}}
run: cmake --preset windows-release

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: cmake --build ${{github.workspace}}\out\build\windows-release

- name: Install
run: cmake --install ${{github.workspace}}/out --config ${{env.BUILD_TYPE}}
run: cmake --install ${{github.workspace}}\out\build\windows-release

- name: Upload artifact windows-release-${{ steps.vars.outputs.sha_short }}.zip
if: ${{ !env.ACT }}
Expand Down
41 changes: 41 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": 2,
"configurePresets": [
{
"name": "windows-release",
"displayName": "Windows x64 Release",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
},
{
"name": "windows-debug",
"displayName": "Windows x64 Debug",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
}
]
}

0 comments on commit 5e6267d

Please sign in to comment.