Skip to content

Commit a39dc79

Browse files
component-configuration-crypto: Migrated build_psa_alt_headers to cmake
Signed-off-by: Minos Galanakis <[email protected]>
1 parent 8ad9dc9 commit a39dc79

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/scripts/components-configuration-crypto.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,15 +2439,21 @@ component_build_psa_config_file () {
24392439
component_build_psa_alt_headers () {
24402440
msg "build: make with PSA alt headers" # ~20s
24412441

2442+
PSA_ALT_HDRS="$PWD/framework/tests/include/alt-extra"
24422443
# Generate alternative versions of the substitutable headers with the
24432444
# same content except different include guards.
2444-
make -C tests ../framework/tests/include/alt-extra/psa/crypto_platform_alt.h ../framework/tests/include/alt-extra/psa/crypto_struct_alt.h
2445+
sed -E 's/^(# *(define|ifndef) +[A-Za-z0-9_]+)_H\b/\1_ALT_H/' \
2446+
tf-psa-crypto/include/psa/crypto_platform.h \
2447+
> $PSA_ALT_HDRS/psa/crypto_platform_alt.h
2448+
2449+
sed -E 's/^(# *(define|ifndef) +[A-Za-z0-9_]+)_H\b/\1_ALT_H/' \
2450+
tf-psa-crypto/include/psa/crypto_struct.h \
2451+
> $PSA_ALT_HDRS/psa/crypto_struct_alt.h
24452452

24462453
# Build the library and some programs.
2447-
# Don't build the fuzzers to avoid having to go through hoops to set
2448-
# a correct include path for programs/fuzz/Makefile.
2449-
$MAKE_COMMAND CFLAGS="-I ../framework/tests/include/alt-extra -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\"psa/crypto_platform_alt.h\"' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\"psa/crypto_struct_alt.h\"'" lib
2450-
make -C programs -o fuzz CFLAGS="-I ../framework/tests/include/alt-extra -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\"psa/crypto_platform_alt.h\"' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\"psa/crypto_struct_alt.h\"'"
2454+
CFLAGS="-I$PSA_ALT_HDRS -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\"psa/crypto_platform_alt.h\"' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\"psa/crypto_struct_alt.h\"'" cmake -D CMAKE_BUILD_TYPE:String=Release .
2455+
cmake --build . --target lib
2456+
cmake --build . --target programs
24512457

24522458
# Check that we're getting the alternative include guards and not the
24532459
# original include guards.

0 commit comments

Comments
 (0)