Skip to content

Commit

Permalink
nkro as a feature
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Jan 1, 2025
1 parent 58b0611 commit 3c71d65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ name: Build

jobs:
build:
strategy:
matrix:
nkro: [enabled, disabled]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -20,13 +23,13 @@ jobs:
name: smk
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Setup
run: nix develop --command meson setup build
run: nix develop --command meson setup build -Dnkro=${{ matrix.nkro }}
- name: Build
run: nix develop --command meson compile -C build
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: firmware
name: smk-${{ matrix.nkro == 'enabled' && 'nkro' || 'default' }}-coverage
path: build/*.hex

lint:
Expand Down
7 changes: 5 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project(
'smk',
'c',
version: 'alpha',
meson_version: '>=0.53.0'
meson_version: '>=1.1.0'
)

fs = import('fs')
Expand Down Expand Up @@ -111,9 +111,12 @@ cc_base_args = [
'--out-fmt-ihx',

'-DSMK_VERSION=@0@'.format(meson.project_version()),
'-DNKRO_ENABLE=1', # TODO: move it into a feature
]

if get_option('nkro').enabled()
cc_base_args += '-DNKRO_ENABLE=1'
endif

if get_option('buildtype') == 'debug'
cc_base_args += '-DDEBUG=1'
endif
Expand Down
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('nkro', type : 'feature', value : 'enabled', description: 'NKRO support')

0 comments on commit 3c71d65

Please sign in to comment.