cmake: some formatting fixes

Do not include bootloader in flash target when secure boot is enabled.
Emit signing warning on all cases where signed apps are enabled (secure
boot and signed images)
Follow convention of capital letters for SECURE_BOOT_SIGNING_KEY
variable, since it is
relevant to other components, not just bootloader.
Pass signing key and verification key via config, not requiring
bootloader to know parent app dir.
Misc. variables name corrections
This commit is contained in:
Renz Christian Bagaporo 2019-06-21 14:29:32 +08:00
parent 047cf71c01
commit 9b350f9ecc
25 changed files with 491 additions and 467 deletions

View file

@ -1,7 +1,9 @@
set(srcs "app_trace.c"
set(srcs
"app_trace.c"
"app_trace_util.c"
"host_file_io.c"
"gcov/gcov_rtio.c")
set(include_dirs "include")
if(CONFIG_SYSVIEW_ENABLE)
@ -10,7 +12,8 @@ if(CONFIG_SYSVIEW_ENABLE)
sys_view/SEGGER
sys_view/Sample/OS)
list(APPEND srcs "sys_view/SEGGER/SEGGER_SYSVIEW.c"
list(APPEND srcs
"sys_view/SEGGER/SEGGER_SYSVIEW.c"
"sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c"
"sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c"
"sys_view/esp32/SEGGER_RTT_esp32.c"

View file

@ -1,4 +1,5 @@
idf_component_register(SRCS "esp_ota_ops.c" "esp_app_desc.c"
idf_component_register(SRCS "esp_ota_ops.c"
"esp_app_desc.c"
INCLUDE_DIRS "include"
REQUIRES spi_flash partition_table bootloader_support)

View file

@ -1,4 +1,5 @@
set(srcs "src/bootloader_clock.c"
set(srcs
"src/bootloader_clock.c"
"src/bootloader_common.c"
"src/bootloader_flash.c"
"src/bootloader_random.c"
@ -11,7 +12,8 @@ if(BOOTLOADER_BUILD)
set(include_dirs "include" "include_bootloader")
set(requires soc) #unfortunately the header directly uses SOC registers
set(priv_requires micro-ecc spi_flash efuse)
list(APPEND srcs "src/bootloader_init.c"
list(APPEND srcs
"src/bootloader_init.c"
"src/${IDF_TARGET}/bootloader_sha.c"
"src/${IDF_TARGET}/flash_encrypt.c"
"src/${IDF_TARGET}/secure_boot_signatures.c"
@ -51,7 +53,8 @@ if(BOOTLOADER_BUILD)
"${secure_boot_verification_key}")
endif()
else()
list(APPEND srcs "src/idf/bootloader_sha.c"
list(APPEND srcs
"src/idf/bootloader_sha.c"
"src/idf/secure_boot_signatures.c")
set(include_dirs "include")
set(priv_include_dirs "include_bootloader")

View file

@ -1,6 +1,7 @@
set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2)
set(srcs "libcoap/src/address.c"
set(srcs
"libcoap/src/address.c"
"libcoap/src/async.c"
"libcoap/src/block.c"
"libcoap/src/coap_event.c"

View file

@ -1,4 +1,5 @@
set(srcs "can.c"
set(srcs
"can.c"
"gpio.c"
"i2c.c"
"i2s.c"

View file

@ -7,7 +7,8 @@ if(EXISTS "${COMPONENT_DIR}/${soc_name}")
set(include_dirs include ${soc_name}/include)
endif()
list(APPEND srcs "src/esp_efuse_api.c"
list(APPEND srcs
"src/esp_efuse_api.c"
"src/esp_efuse_fields.c"
"src/esp_efuse_utility.c")

View file

@ -4,7 +4,8 @@ if(BOOTLOADER_BUILD)
target_linker_script(${COMPONENT_LIB} INTERFACE "ld/esp32.peripherals.ld")
else()
# Regular app build
set(srcs "brownout.c"
set(srcs
"brownout.c"
"cache_err_int.c"
"cache_sram_mmu.c"
"clk.c"

View file

@ -6,5 +6,5 @@ idf_component_register(SRCS "src/httpd_main.c"
"src/util/ctrl_sock.c"
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "src/port/esp32" "src/util"
REQUIRES nghttp
PRIV_REQUIRES lwip) # for http_parser.h
REQUIRES nghttp # for http_parser.h
PRIV_REQUIRES lwip)

View file

@ -1,24 +1,21 @@
idf_build_get_property(idf_target IDF_TARGET)
idf_build_get_property(build_dir BUILD_DIR)
set(srcs
"src/coexist.c"
"src/fast_crypto_ops.c"
"src/lib_printf.c"
"src/mesh_event.c"
"src/phy_init.c"
"src/restore.c"
"src/wifi_init.c")
if(NOT CONFIG_ESP32_NO_BLOBS)
set(ldfragments "linker.lf")
endif()
idf_component_register(SRCS "${srcs}"
idf_component_register(SRCS "src/coexist.c"
"src/fast_crypto_ops.c"
"src/lib_printf.c"
"src/mesh_event.c"
"src/phy_init.c"
"src/restore.c"
"src/wifi_init.c"
INCLUDE_DIRS "include" "${idf_target}/include"
PRIV_REQUIRES wpa_supplicant nvs_flash
LDFRAGMENTS "${ldfragments}")
idf_build_get_property(build_dir BUILD_DIR)
target_link_libraries(${COMPONENT_LIB} PUBLIC "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${idf_target}")
if(NOT CONFIG_ESP32_NO_BLOBS)

View file

@ -1,4 +1,4 @@
set(srcs "src/diskio.c"
idf_component_register(SRCS "src/diskio.c"
"src/diskio_rawflash.c"
"src/diskio_sdmmc.c"
"src/diskio_wl.c"
@ -7,8 +7,6 @@ set(srcs "src/diskio.c"
"src/ffunicode.c"
"src/vfs_fat.c"
"src/vfs_fat_sdmmc.c"
"src/vfs_fat_spiflash.c")
idf_component_register(SRCS "${srcs}"
"src/vfs_fat_spiflash.c"
INCLUDE_DIRS src
REQUIRES wear_levelling sdmmc)

View file

@ -1,6 +1,7 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
set(srcs "common/esp_modbus_master.c"
set(srcs
"common/esp_modbus_master.c"
"common/esp_modbus_slave.c"
"modbus/mb.c"
"modbus/mb_m.c"

View file

@ -1,4 +1,5 @@
set(srcs "croutine.c"
set(srcs
"croutine.c"
"event_groups.c"
"FreeRTOS-openocd.c"
"list.c"
@ -14,6 +15,7 @@ set(srcs "croutine.c"
"xtensa_overlay_os_hook.c"
"xtensa_vector_defaults.S"
"xtensa_vectors.S")
# app_trace is required by FreeRTOS headers only when CONFIG_SYSVIEW_ENABLE=y,
# but requirements can't depend on config options, so always require it.
idf_component_register(SRCS "${srcs}"

View file

@ -1,4 +1,5 @@
set(srcs "heap_caps.c"
set(srcs
"heap_caps.c"
"heap_caps_init.c"
"multi_heap.c")

View file

@ -1,7 +1,8 @@
set(SRC libsodium/src/libsodium)
# Derived from libsodium/src/libsodium/Makefile.am
# (ignoring the !MINIMAL set)
set(srcs "${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c"
set(srcs
"${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c"
"${SRC}/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c"
"${SRC}/crypto_auth/crypto_auth.c"
"${SRC}/crypto_auth/hmacsha256/auth_hmacsha256.c"
@ -116,10 +117,12 @@ set(srcs "${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c"
"port/randombytes_esp32.c")
if(CONFIG_LIBSODIUM_USE_MBEDTLS_SHA)
list(APPEND srcs "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c"
list(APPEND srcs
"port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c"
"port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c")
else()
list(APPEND srcs "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c"
list(APPEND srcs
"${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c"
"${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c")
endif()

View file

@ -6,7 +6,8 @@ set(include_dirs
port/esp32/include/arch
)
set(srcs "apps/dhcpserver/dhcpserver.c"
set(srcs
"apps/dhcpserver/dhcpserver.c"
"apps/ping/esp_ping.c"
"apps/ping/ping.c"
"apps/sntp/sntp.c"
@ -91,7 +92,8 @@ set(srcs "apps/dhcpserver/dhcpserver.c"
"port/esp32/netif/wlanif.c")
if(CONFIG_LWIP_PPP_SUPPORT)
list(APPEND srcs "lwip/src/netif/ppp/auth.c"
list(APPEND srcs
"lwip/src/netif/ppp/auth.c"
"lwip/src/netif/ppp/ccp.c"
"lwip/src/netif/ppp/chap-md5.c"
"lwip/src/netif/ppp/chap-new.c"

View file

@ -1,4 +1,5 @@
set(srcs "heap.c"
set(srcs
"heap.c"
"locks.c"
"poll.c"
"pthread.c"

View file

@ -1,4 +1,5 @@
set(srcs "nghttp2/lib/nghttp2_buf.c"
set(srcs
"nghttp2/lib/nghttp2_buf.c"
"nghttp2/lib/nghttp2_callbacks.c"
"nghttp2/lib/nghttp2_debug.c"
"nghttp2/lib/nghttp2_frame.c"

View file

@ -2,7 +2,8 @@ set(include_dirs include/common
include/security
include/transports)
set(priv_include_dirs proto-c src/common src/simple_ble)
set(srcs "src/common/protocomm.c"
set(srcs
"src/common/protocomm.c"
"src/security/security0.c"
"src/security/security1.c"
"proto-c/constants.pb-c.c"

View file

@ -9,7 +9,8 @@ if(EXISTS "${COMPONENT_DIR}/${soc_name}")
endif()
list(APPEND include_dirs include)
list(APPEND srcs "src/memory_layout_utils.c"
list(APPEND srcs
"src/memory_layout_utils.c"
"src/lldesc.c"
"src/hal/spi_hal.c"
"src/hal/spi_hal_iram.c"

View file

@ -4,7 +4,8 @@ if(BOOTLOADER_BUILD)
# need other parts of this component
set(srcs "spi_flash_rom_patch.c")
else()
set(srcs "cache_utils.c"
set(srcs
"cache_utils.c"
"flash_mmap.c"
"flash_ops.c"
"partition.c"
@ -14,8 +15,7 @@ else()
"spi_flash_chip_issi.c"
"spi_flash_os_func_app.c"
"spi_flash_os_func_noos.c"
"memspi_host_driver.c"
)
"memspi_host_driver.c")
if(NOT CONFIG_SPI_FLASH_USE_LEGACY_IMPL)
list(APPEND srcs "esp_flash_api.c")
endif()

View file

@ -1,4 +1,5 @@
set(srcs "unity/src/unity.c"
set(srcs
"unity/src/unity.c"
"unity_port_esp32.c")
if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL)

View file

@ -1,4 +1,5 @@
set(srcs "port/os_xtensa.c"
set(srcs
"port/os_xtensa.c"
"src/crypto/aes-cbc.c"
"src/crypto/aes-internal-dec.c"
"src/crypto/aes-internal-enc.c"

View file

@ -1,5 +1,8 @@
idf_build_get_property(target IDF_TARGET)
idf_component_register(SRCS "eri.c" "trax.c" "debug_helpers.c" "debug_helpers_asm.S"
idf_component_register(SRCS "debug_helpers.c"
"debug_helpers_asm.S"
"eri.c"
"trax.c"
INCLUDE_DIRS include ${target}/include
LDFRAGMENTS linker.lf
PRIV_REQUIRES soc)