Skip to content

Commit 6d5df60

Browse files
authored
Merge pull request #438 from dgarske/cmake_tpm_modules
CMake improvements (add TPM module choice) - sync to configure
2 parents 4a5c755 + a88d7ba commit 6d5df60

File tree

16 files changed

+631
-296
lines changed

16 files changed

+631
-296
lines changed

.github/workflows/cmake-build.yml

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,77 @@ jobs:
1010
build:
1111

1212
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
config:
17+
# Default configuration (SWTPM first)
18+
- name: "Defaults"
19+
options: ""
20+
# ST33 supports both SPI and I2C
21+
- name: "Module ST33 SPI"
22+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=st33"
23+
- name: "Module ST33 I2C"
24+
options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_MODULE=st33"
25+
# Other modules use SPI
26+
- name: "Module Microchip"
27+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=microchip"
28+
- name: "Module Nuvoton"
29+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=nuvoton"
30+
- name: "Module SLB9670"
31+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=slb9670"
32+
- name: "Module SLB9672"
33+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=slb9672"
34+
# SLB9673 is I2C
35+
- name: "Module SLB9673 I2C"
36+
options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_MODULE=slb9673"
37+
# Test wrapper disabled
38+
- name: "No Wrapper"
39+
options: "-DWOLFTPM_WRAPPER=no"
40+
# Test I2C support (enables ADV_IO automatically)
41+
- name: "I2C Enabled (legacy)"
42+
options: "-DWOLFTPM_I2C=yes"
43+
# Test interface options
44+
- name: "Interface I2C"
45+
options: "-DWOLFTPM_INTERFACE=I2C"
46+
- name: "Interface SPI"
47+
options: "-DWOLFTPM_INTERFACE=SPI"
48+
# Test Advanced IO
49+
- name: "Advanced IO"
50+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_ADVIO=yes"
51+
- name: "Advanced IO I2C"
52+
options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_ADVIO=yes"
53+
# Test MMIO (enables ADV_IO automatically)
54+
- name: "MMIO Enabled"
55+
options: "-DWOLFTPM_MMIO=yes"
56+
# Test Check Wait State
57+
- name: "Check Wait State Enabled"
58+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_CHECK_WAIT_STATE=yes"
59+
- name: "Check Wait State Disabled"
60+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_CHECK_WAIT_STATE=no"
61+
# Test TIS Lock
62+
- name: "TIS Lock Enabled"
63+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_TIS_LOCK=yes"
64+
# Test Small Stack
65+
- name: "Small Stack"
66+
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_SMALL_STACK=yes"
67+
# Test HAL disabled
68+
- name: "No HAL"
69+
options: "-DWOLFTPM_HAL=no"
70+
# Test Firmware disabled
71+
- name: "No Firmware"
72+
options: "-DWOLFTPM_FIRMWARE=no"
73+
# Test Debug modes
74+
- name: "Debug Verbose"
75+
options: "-DWOLFTPM_DEBUG=verbose"
76+
- name: "Debug IO"
77+
options: "-DWOLFTPM_DEBUG=io"
78+
# Test Examples disabled
79+
- name: "No Examples"
80+
options: "-DWOLFTPM_EXAMPLES=no"
81+
# Test combination of options
82+
- name: "Combined Options"
83+
options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_MODULE=st33 -DWOLFTPM_ADVIO=yes -DWOLFTPM_CHECK_WAIT_STATE=yes"
1384

1485
steps:
1586
#pull wolfTPM
@@ -38,10 +109,10 @@ jobs:
38109
cmake --install .
39110
40111
#build wolftpm
41-
- name: Build wolfTPM
112+
- name: Build wolfTPM (${{ matrix.config.name }})
42113
run: |
43114
mkdir build
44115
cd build
45-
cmake -DWOLFTPM_INTERFACE=SWTPM -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" -DWITH_WOLFSSL="$GITHUB_WORKSPACE/install" ..
116+
cmake ${{ matrix.config.options }} -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" -DWITH_WOLFSSL="$GITHUB_WORKSPACE/install" ..
46117
cmake --build .
47118
cmake --install .

0 commit comments

Comments
 (0)