Skip to content

Commit b804f25

Browse files
committed
nkro as a feature
1 parent 58b0611 commit b804f25

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ name: Build
77

88
jobs:
99
build:
10+
strategy:
11+
matrix:
12+
nkro: [enabled, disabled]
1013
runs-on: ubuntu-latest
1114
steps:
1215
- uses: actions/checkout@v4
@@ -20,13 +23,13 @@ jobs:
2023
name: smk
2124
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
2225
- name: Setup
23-
run: nix develop --command meson setup build
26+
run: nix develop --command meson setup build -Dnkro=${{ matrix.nkro }}
2427
- name: Build
2528
run: nix develop --command meson compile -C build
2629
- name: Archive code coverage results
2730
uses: actions/upload-artifact@v4
2831
with:
29-
name: firmware
32+
name: smk-${{ matrix.nkro == 'enabled' && 'nkro' || '6kro' }}
3033
path: build/*.hex
3134

3235
lint:

meson.build

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ project(
22
'smk',
33
'c',
44
version: 'alpha',
5-
meson_version: '>=0.53.0'
5+
meson_version: '>=1.1.0'
66
)
77

88
fs = import('fs')
@@ -111,9 +111,12 @@ cc_base_args = [
111111
'--out-fmt-ihx',
112112

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

116+
if get_option('nkro').enabled()
117+
cc_base_args += '-DNKRO_ENABLE=1'
118+
endif
119+
117120
if get_option('buildtype') == 'debug'
118121
cc_base_args += '-DDEBUG=1'
119122
endif

meson.options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
option('nkro', type : 'feature', value : 'enabled', description: 'NKRO support')

0 commit comments

Comments
 (0)