Skip to content

Commit 3f3fd2b

Browse files
committed
crypto/mbedtls: Use config defining flag globally
Now -DMBEDTLS_USER_CONFIG_FILE=<mbedtls/config_mynewt.h> flag is used globally for each build that depends on mbedtls package. This way we won't have to add this flag in each package that uses mbedtls.
1 parent 165790f commit 3f3fd2b

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

apps/crypto_test/pkg.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ pkg.deps:
2828
- "@apache-mynewt-core/sys/log"
2929
- "@apache-mynewt-core/crypto/mbedtls"
3030
- "@apache-mynewt-core/crypto/tinycrypt"
31-
32-
pkg.cflags: '-DMBEDTLS_USER_CONFIG_FILE="mbedtls/config_mynewt.h"'

apps/hash_test/pkg.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ pkg.deps:
2828
- "@apache-mynewt-core/sys/log"
2929
- "@apache-mynewt-core/crypto/mbedtls"
3030
- "@apache-mynewt-core/crypto/tinycrypt"
31-
32-
pkg.cflags: '-DMBEDTLS_USER_CONFIG_FILE="mbedtls/config_mynewt.h"'

crypto/mbedtls/include/mbedtls/config_mynewt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ extern "C" {
4242
#define MBEDTLS_NO_PLATFORM_ENTROPY
4343
#undef MBEDTLS_NET_C
4444

45-
#ifndef TEST
4645
#undef MBEDTLS_SELF_TEST
46+
#if MYNEWT_VAL(TEST)
47+
#define MBEDTLS_SELF_TEST
4748
#endif
4849

4950
#define MBEDTLS_SHA256_SMALLER /* Comes with performance hit */

crypto/mbedtls/pkg.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ pkg.keywords:
2626
- tls
2727
pkg.type: sdk
2828

29-
pkg.cflags:
29+
app.cflags:
3030
- '-DMBEDTLS_USER_CONFIG_FILE=<mbedtls/config_mynewt.h>'
31+
32+
pkg.cflags:
3133
- -Wno-maybe-uninitialized
3234
- -Wno-unknown-warning-option
3335
pkg.cflags.TEST: -DTEST

0 commit comments

Comments
 (0)