2021-12-02 00:07:11 +01:00
|
|
|
# For more information about build system see
|
|
|
|
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
|
|
|
|
# The following five lines of boilerplate have to be in your project's
|
|
|
|
# CMakeLists in this exact order for cmake to work correctly
|
2022-05-27 10:10:51 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2021-12-02 00:07:11 +01:00
|
|
|
|
|
|
|
set(g0_components soc hal esp_common esp_rom) # also <arch>, i.e. xtensa or riscv, will be added below
|
2022-11-03 15:36:01 +08:00
|
|
|
set(g1_components spi_flash freertos log heap newlib esp_system esp_hw_support esp_mm)
|
2021-12-02 00:07:11 +01:00
|
|
|
set(COMPONENTS ${g0_components} ${g1_components} main)
|
|
|
|
|
|
|
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
|
|
|
|
|
|
|
idf_build_set_property(__BUILD_COMPONENT_DEPGRAPH_ENABLED 1)
|
|
|
|
|
|
|
|
project(g1_components)
|
|
|
|
|
|
|
|
set(extra_allowed_components
|
|
|
|
${CONFIG_IDF_TARGET_ARCH}
|
|
|
|
)
|
|
|
|
|
|
|
|
# These components are currently included into "G1" build, but shouldn't.
|
|
|
|
# After removing the extra dependencies, remove the components from this list as well.
|
|
|
|
set(extra_components_which_shouldnt_be_included
|
2024-07-08 11:43:41 +08:00
|
|
|
# app_update gets added because of spi_flash and esp_partition.
|
|
|
|
# esp_partition will get removed from g1 and spi_flash does not actually seem to need app_update anymore.
|
|
|
|
# When esp-partition is removed from g1 build it should be easy for us to also remove app-update # TODO IDF-8577
|
2021-12-02 00:07:11 +01:00
|
|
|
app_update
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# bootloader is only included from esptool_py, which should be removed from G1
|
2021-12-02 00:07:11 +01:00
|
|
|
bootloader
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# bootloader_support is a dependency of the following G1 components:
|
|
|
|
# spi_flash, esp_system, esp_hw_support.
|
|
|
|
# as well as the following non G1 components:
|
|
|
|
# efuse, app_update, esp_partition
|
|
|
|
# Challenging to remove: IDF-8581 for more details
|
2021-12-02 00:07:11 +01:00
|
|
|
bootloader_support
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# should cxx be in G1? Can it exist without FreeRTOS? IDF-9511
|
2021-12-02 00:07:11 +01:00
|
|
|
cxx
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# esp_driver_gpio is a dependency of esp_pm (should be removed from g1 builds),
|
|
|
|
# as well as spi_flash, esp_hw_support, IDF-10387
|
2023-11-14 11:14:34 +08:00
|
|
|
esp_driver_gpio
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# esp_app_format is dependency of bootloader_support, app_update, efuse.
|
|
|
|
# All components that should be removed from G1
|
2022-07-29 16:07:04 +05:30
|
|
|
esp_app_format
|
2024-07-08 11:43:41 +08:00
|
|
|
|
2022-12-14 01:16:56 +08:00
|
|
|
# esp_bootloader_format is dependency of bootloader_support, app_update
|
2024-07-08 11:43:41 +08:00
|
|
|
# All components that should be removed from G1
|
2022-12-14 01:16:56 +08:00
|
|
|
esp_bootloader_format
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# Dependency of bootloader_support, app_update, and esp_hw_support
|
2024-01-11 20:59:08 +08:00
|
|
|
# Figure out if the esp_hw_support component can exist without a dependency on efuse.
|
|
|
|
# efuse is used by the ADC calibration functions in esp_hw_support/adc_share_hw_ctrl.c,
|
|
|
|
# it could use the efuse hal (if virtual efuse mode is not used for tests).
|
2021-12-02 00:07:11 +01:00
|
|
|
# If not, see if esp_hw_support can provide minimal efuse component replacement in G1 build.
|
2024-07-08 11:43:41 +08:00
|
|
|
# Also used by security features (hmac and key-manager) and MAC support
|
2021-12-02 00:07:11 +01:00
|
|
|
efuse
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# esp_pm is pulled in by esp_system due to pm_init and freertos idle hook
|
|
|
|
# both could be moved to pm component if esp-system idle hook provided a way to register hooks
|
|
|
|
# esp_hw_support dependency seems like it could be removed?
|
|
|
|
# It is also used by esp_driver_gpio, mbedtls all of which should be removed from G1-only build.
|
|
|
|
# IDF-10415
|
2021-12-02 00:07:11 +01:00
|
|
|
esp_pm
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# esp_timer is a dependency of esp_pm, esp_system and esp_hw_support
|
|
|
|
# esp_pm should be removed from G1 build
|
|
|
|
# esp_system's dependency is due to usb_console (used for timeout functionality)
|
|
|
|
# and task_wdt timer implementation on C2, we could possibly place this implementation in esp_timer instead
|
|
|
|
# esp_hw_support uses it for esp_ds (used for timeout functionality)
|
|
|
|
# and for componensating time after sleep (dependency could be reversed) IDF-10416
|
2021-12-02 00:07:11 +01:00
|
|
|
esp_timer
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# esptool_py is a dependency of bootloader, app_update, partition_table, all of which
|
2021-12-02 00:07:11 +01:00
|
|
|
# should be removed from G1-only build.
|
|
|
|
esptool_py
|
2024-07-08 11:43:41 +08:00
|
|
|
|
2021-12-02 00:07:11 +01:00
|
|
|
# mbedtls is a dependency of bootloader_support (plus other easier-to-remove ones)
|
|
|
|
# it is hard to make it conditional, need to remove bootloader_support.
|
|
|
|
mbedtls
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# partition_table is pulled in by app_update, esptool_py, bootloader, esp_partition; all to be removed
|
2021-12-02 00:07:11 +01:00
|
|
|
partition_table
|
2024-07-08 11:43:41 +08:00
|
|
|
|
|
|
|
# esp_partition is a new component for separated IDF partition APIs. Pulled in from app_update and efuse,
|
|
|
|
# both which should be removed
|
2022-10-14 14:15:32 +02:00
|
|
|
esp_partition
|
2024-07-08 11:43:41 +08:00
|
|
|
|
2024-02-05 17:38:53 +08:00
|
|
|
# pthread is required by cxx. See [refactor-todo] about cxx, can it work without pthread?
|
2021-12-02 00:07:11 +01:00
|
|
|
pthread
|
|
|
|
)
|
|
|
|
|
|
|
|
set(expected_components
|
|
|
|
${COMPONENTS}
|
|
|
|
${extra_allowed_components}
|
|
|
|
${extra_components_which_shouldnt_be_included}
|
|
|
|
)
|
|
|
|
|
|
|
|
list(SORT expected_components)
|
|
|
|
|
|
|
|
|
|
|
|
idf_build_get_property(build_components BUILD_COMPONENTS)
|
|
|
|
list(SORT build_components)
|
|
|
|
|
|
|
|
if(NOT "${expected_components}" STREQUAL "${build_components}")
|
|
|
|
message(FATAL_ERROR "Unexpected components list in G1 build. "
|
|
|
|
"Expected: ${expected_components}. "
|
|
|
|
"Actual: ${build_components}")
|
|
|
|
endif()
|