Skip to content

Commit

Permalink
Cleanup CMakeLists.txt, remove obsolete stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
maximkulkin committed Apr 27, 2020
1 parent ec644a4 commit 46eac7e
Showing 1 changed file with 36 additions and 56 deletions.
92 changes: 36 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
set(HOMEKIT_SRCS
"src/json.c"
"src/storage.c"
"src/tlv.c "
"src/server.c"
"src/debug.c"
"src/accessories.c"
"src/base64.c"
"src/port.c"
"src/query_params.c"
"src/crypto.c"
)

set(COMPONENT_SRCS ${HOMEKIT_SRCS})

set(COMPONENT_ADD_INCLUDEDIRS
"src"
"include"
)

set(COMPONENT_PRIV_INCLUDEDIRS "src")

set(COMPONENT_REQUIRES wolfssl json http-parser mdns spi_flash)

idf_component_register(
SRCS ${COMPONENT_SRCS}
INCLUDE_DIRS ${COMPONENT_ADD_INCLUDEDIRS}
PRIV_INCLUDE_DIRS ${COMPONENT_PRIV_INCLUDEDIRS}
REQUIRES ${COMPONENT_REQUIRES}
SRCS
"src/json.c"
"src/storage.c"
"src/tlv.c"
"src/server.c"
"src/debug.c"
"src/accessories.c"
"src/base64.c"
"src/port.c"
"src/query_params.c"
"src/crypto.c"
INCLUDE_DIRS include
PRIV_INCLUDE_DIRS src
REQUIRES wolfssl json http-parser mdns spi_flash
)

set_source_files_properties(src/storage.c
Expand All @@ -35,41 +21,35 @@ set_source_files_properties(src/storage.c
)

set(WOLFSSL_C_FLAGS
"-DWOLFCRYPT_HAVE_SRP \
-DWOLFSSL_SHA512 \
-DWOLFSSL_BASE64_ENCODE \
-DNO_MD5 \
-DNO_SHA \
-DHAVE_HKDF \
-DHAVE_CHACHA \
-DHAVE_POLY1305 \
-DHAVE_ED25519 \
-DHAVE_CURVE25519 \
-DNO_SESSION_CACHE \
-DRSA_LOW_MEM \
-DGCM_SMALL \
-DUSE_SLOW_SHA512 \
-DWC_NO_HARDEN \
-DWOLFCRYPT_ONLY"
"-DWOLFCRYPT_HAVE_SRP \
-DWOLFSSL_SHA512 \
-DWOLFSSL_BASE64_ENCODE \
-DNO_MD5 \
-DNO_SHA \
-DHAVE_HKDF \
-DHAVE_CHACHA \
-DHAVE_POLY1305 \
-DHAVE_ED25519 \
-DHAVE_CURVE25519 \
-DNO_SESSION_CACHE \
-DRSA_LOW_MEM \
-DGCM_SMALL \
-DUSE_SLOW_SHA512 \
-DWC_NO_HARDEN \
-DWOLFCRYPT_ONLY"
)

if(CONFIG_HOMEKIT_SMALL)
set(WOLFSSL_C_FLAGS "${WOLFSSL_C_FLAGS} \
-DCURVE25519_SMALL \
-DED25519_SMALL"
)
set(WOLFSSL_C_FLAGS "${WOLFSSL_C_FLAGS} -DCURVE25519_SMALL -DED25519_SMALL")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
${WOLFSSL_C_FLAGS} \
-DHOMEKIT_MAX_CLIENTS=${CONFIG_HOMEKIT_MAX_CLIENTS} \
-DSPIFLASH_BASE_ADDR=${CONFIG_HOMEKIT_SPI_FLASH_BASE_ADDR} \
-DESP_IDF \
-Wno-error=unused-value"
${WOLFSSL_C_FLAGS} \
-DHOMEKIT_MAX_CLIENTS=${CONFIG_HOMEKIT_MAX_CLIENTS} \
-DSPIFLASH_BASE_ADDR=${CONFIG_HOMEKIT_SPI_FLASH_BASE_ADDR} \
-DESP_IDF"
)

if(CONFIG_HOMEKIT_DEBUG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
-DHOMEKIT_DEBUG"
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHOMEKIT_DEBUG")
endif()

0 comments on commit 46eac7e

Please sign in to comment.