diff --git a/crypto/tinycrypt/CMakeLists.txt b/crypto/tinycrypt/CMakeLists.txt index a44ed6234d3..c75ae88c640 100644 --- a/crypto/tinycrypt/CMakeLists.txt +++ b/crypto/tinycrypt/CMakeLists.txt @@ -64,6 +64,7 @@ if(CONFIG_TINYCRYPT) # Sources # ############################################################################ + list(APPEND CFLAGS -Dunix) set(CSRCS ${TINYCRYPT_DIR}/lib/source/utils.c ${TINYCRYPT_DIR}/lib/source/ecc.c ${TINYCRYPT_DIR}/lib/source/ecc_platform_specific.c) @@ -120,7 +121,7 @@ if(CONFIG_TINYCRYPT) if(CONFIG_TINYCRYPT_TEST) list(APPEND CSRCS ${TINYCRYPT_DIR}/tests/test_ecc_utils.c) list(APPEND INCDIR ${TINYCRYPT_DIR}/tests/include) - set(CFLAGS -Dhex2bin=ltp_hex2bin -DENABLE_TESTS) + list(APPEND CFLAGS -DENABLE_TESTS) nuttx_add_application( NAME diff --git a/crypto/tinycrypt/Makefile b/crypto/tinycrypt/Makefile index 6b3930a910c..70cee243530 100644 --- a/crypto/tinycrypt/Makefile +++ b/crypto/tinycrypt/Makefile @@ -48,6 +48,7 @@ distclean:: $(Q) rm -rf $(TINYCRYPT_UNPACKNAME) endif +CFLAGS += ${DEFINE_PREFIX}unix CSRCS += tinycrypt/lib/source/utils.c ifeq ($(CONFIG_TINYCRYPT_ECC),y) @@ -105,8 +106,7 @@ endif ifeq ($(CONFIG_TINYCRYPT_TEST),y) CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/crypto/tinycrypt/tinycrypt/tests/include - CFLAGS +=-Dhex2bin=ltp_hex2bin - CFLAGS +=-DENABLE_TESTS + CFLAGS += -DENABLE_TESTS CSRCS += tinycrypt/tests/test_ecc_utils.c PRIORITY = $(CONFIG_TINYCRYPT_TEST_PRIORITY) STACKSIZE = $(CONFIG_TINYCRYPT_TEST_STACKSIZE)