diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bca111f..19d0f33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,9 @@ name: Build jobs: build: + strategy: + matrix: + nkro: [enabled, disabled] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -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: diff --git a/meson.build b/meson.build index 3c30ea7..916763a 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'smk', 'c', version: 'alpha', - meson_version: '>=0.53.0' + meson_version: '>=1.1.0' ) fs = import('fs') @@ -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 diff --git a/meson.options b/meson.options new file mode 100644 index 0000000..a2af75d --- /dev/null +++ b/meson.options @@ -0,0 +1 @@ +option('nkro', type : 'feature', value : 'enabled', description: 'NKRO support')