From 1226bc337991411cc916feb8728073546001f59f Mon Sep 17 00:00:00 2001 From: Hideki Miyazaki Date: Wed, 16 Jan 2019 17:37:45 +0900 Subject: [PATCH] fixed cmake build on esp-idf --- .../wolfssl_benchmark/main/CMakeLists.txt | 10 ++ .../wolfssl_client/main/CMakeLists.txt | 10 ++ .../examples/wolfssl_server/CMakeLists.txt | 2 +- .../wolfssl_server/main/CMakeLists.txt | 10 ++ .../examples/wolfssl_test/main/CMakeLists.txt | 10 ++ IDE/Espressif/ESP-IDF/libs/CMakeLists.txt | 97 +++++-------------- IDE/Espressif/ESP-IDF/setup.sh | 2 +- 7 files changed, 67 insertions(+), 74 deletions(-) create mode 100644 IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/CMakeLists.txt create mode 100644 IDE/Espressif/ESP-IDF/examples/wolfssl_client/main/CMakeLists.txt create mode 100644 IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/CMakeLists.txt create mode 100644 IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/CMakeLists.txt diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/CMakeLists.txt b/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/CMakeLists.txt new file mode 100644 index 000000000..dd98b8a94 --- /dev/null +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/CMakeLists.txt @@ -0,0 +1,10 @@ + +# +# wolfssl benchmark test +# +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS") + +set(COMPONENT_SRCS "benchmark.c" "helper.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_client/main/CMakeLists.txt b/IDE/Espressif/ESP-IDF/examples/wolfssl_client/main/CMakeLists.txt new file mode 100644 index 000000000..ca570118c --- /dev/null +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_client/main/CMakeLists.txt @@ -0,0 +1,10 @@ + +# +# wolfssl client test +# +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS") + +set(COMPONENT_SRCS "client-tls.c" "wifi_connect.c") +set(COMPONENT_ADD_INCLUDEDIRS "." "./include") + +register_component() diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_server/CMakeLists.txt b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/CMakeLists.txt index 71455470d..12c649649 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_server/CMakeLists.txt +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/CMakeLists.txt @@ -4,4 +4,4 @@ cmake_minimum_required(VERSION 3.5) include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(tls_server) +project(wolfssl_server) diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/CMakeLists.txt b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/CMakeLists.txt new file mode 100644 index 000000000..4e6e5a5de --- /dev/null +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/CMakeLists.txt @@ -0,0 +1,10 @@ + +# +# wolfssl server test +# +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS") + +set(COMPONENT_SRCS "server-tls.c" "wifi_connect.c") +set(COMPONENT_ADD_INCLUDEDIRS "." "./include") + +register_component() diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/CMakeLists.txt b/IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/CMakeLists.txt new file mode 100644 index 000000000..20be3f093 --- /dev/null +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/CMakeLists.txt @@ -0,0 +1,10 @@ + +# +# wolfssl crypt test +# +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS") + +set(COMPONENT_SRCS "test.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/IDE/Espressif/ESP-IDF/libs/CMakeLists.txt b/IDE/Espressif/ESP-IDF/libs/CMakeLists.txt index 78fe8a073..d26a853f8 100644 --- a/IDE/Espressif/ESP-IDF/libs/CMakeLists.txt +++ b/IDE/Espressif/ESP-IDF/libs/CMakeLists.txt @@ -1,79 +1,32 @@ +# +# cmake for wolfssl +# cmake_minimum_required(VERSION 3.5) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS") set(CMAKE_CURRENT_SOURCE_DIR ".") set(WOLFSSL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) set(INCLUDE_PATH ${WOLFSSL_ROOT}) -set(COMPONENT_SRCS - "src/keys.c" - "src/sniffer.c" - "src/tls.c" - "src/wolfio.c" - "src/crl.c" - "src/internal.c" - "src/ocsp.c" - "src/ssl.c" - "src/tls13.c" - "wolfcrypt/src/aes.c" - "wolfcrypt/src/arc4.c" - "wolfcrypt/src/asm.c" - "wolfcrypt/src/asn.c" - "wolfcrypt/src/blake2b.c" - "wolfcrypt/src/camellia.c" - "wolfcrypt/src/chacha.c" - "wolfcrypt/src/chacha20_poly1305.c" - "wolfcrypt/src/cmac.c" - "wolfcrypt/src/coding.c" - "wolfcrypt/src/compress.c" - "wolfcrypt/src/cpuid.c" - "wolfcrypt/src/cryptodev.c" - "wolfcrypt/src/curve25519.c" - "wolfcrypt/src/des3.c" - "wolfcrypt/src/dh.c" - "wolfcrypt/src/dsa.c" - "wolfcrypt/src/ecc.c" - "wolfcrypt/src/ecc_fp.c" - "wolfcrypt/src/ed25519.c" - "wolfcrypt/src/error.c" - "wolfcrypt/src/fe_low_mem.c" - "wolfcrypt/src/fe_operations.c" - "wolfcrypt/src/ge_low_mem.c" - "wolfcrypt/src/ge_operations.c" - "wolfcrypt/src/hash.c" - "wolfcrypt/src/hc128.c" - "wolfcrypt/src/hmac.c" - "wolfcrypt/src/idea.c" - "wolfcrypt/src/integer.c" - "wolfcrypt/src/logging.c" - "wolfcrypt/src/md2.c" - "wolfcrypt/src/md4.c" - "wolfcrypt/src/md5.c" - "wolfcrypt/src/memory.c" - "wolfcrypt/src/pkcs12.c" - "wolfcrypt/src/pkcs7.c" - "wolfcrypt/src/poly1305.c" - "wolfcrypt/src/pwdbased.c" - "wolfcrypt/src/rabbit.c" - "wolfcrypt/src/random.c" - "wolfcrypt/src/ripemd.c" - "wolfcrypt/src/rsa.c" - "wolfcrypt/src/sha.c" - "wolfcrypt/src/sha256.c" - "wolfcrypt/src/sha3.c" - "wolfcrypt/src/sha512.c" - "wolfcrypt/src/signature.c" - "wolfcrypt/src/sp_arm32.c" - "wolfcrypt/src/sp_arm64.c" - "wolfcrypt/src/sp_c32.c" - "wolfcrypt/src/sp_c64.c" - "wolfcrypt/src/sp_int.c" - "wolfcrypt/src/sp_x86_64.c" - "wolfcrypt/src/srp.c" - "wolfcrypt/src/tfm.c" - "wolfcrypt/src/wc_encrypt.c" - "wolfcrypt/src/wc_port.c" - "wolfcrypt/src/wolfevent.c" - "wolfcrypt/src/wolfmath.c" -) + +set(COMPONENT_SRCDIRS "./src/" + "./wolfcrypt/src/" + "./wolfcrypt/src/port/Espressif/" + ) + set(COMPONENT_REQUIRES lwip) -set(COMPONENT_ADD_INCLUDEDIRS ../freertos/include/freertos) + +set(COMPONENT_ADD_INCLUDEDIRS + "." + "./include" + "../freertos/include/freertos" + "${WOLFSSL_ROOT}" + ) + +set(COMPONENT_SRCEXCLUDE + "wolfcrypt/src/aes_asm.S" + "wolfcrypt/src/evp.c" + "wolfcrypt/src/misc.c" + "src/bio.c" + ) + register_component() diff --git a/IDE/Espressif/ESP-IDF/setup.sh b/IDE/Espressif/ESP-IDF/setup.sh index 0eae5459d..77f78efa1 100755 --- a/IDE/Espressif/ESP-IDF/setup.sh +++ b/IDE/Espressif/ESP-IDF/setup.sh @@ -47,7 +47,7 @@ pushd ${BASEDIR} > /dev/null # WOLFSSL TOP DIR # copying ... files in src/ into $WOLFSSLLIB_TRG_DIR/src ${CPDCMD} ./src/*.c ${WOLFSSLLIB_TRG_DIR}/src/ -${CPDCMD} -r ./wolfcrypt/src/ ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/ +${CPDCMD} -r ./wolfcrypt/src ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/ ${CPDCMD} -r ./wolfcrypt/test ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/ ${CPDCMD} -r ./wolfcrypt/benchmark ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/