esp-idf/components/esp_system/CMakeLists.txt

138 wiersze
4.8 KiB
CMake
Czysty Zwykły widok Historia

2021-01-26 02:48:12 +00:00
idf_build_get_property(target IDF_TARGET)
# On Linux, we only support a few features, hence this simple component registration
if(${target} STREQUAL "linux")
idf_component_register(SRCS "esp_system.c"
"port/soc/linux/reset_reason.c"
"port/soc/linux/system_internal.c"
"port/esp_system_linux.c"
INCLUDE_DIRS "include")
return()
endif()
set(srcs "esp_err.c")
2021-01-26 02:48:12 +00:00
if(CONFIG_IDF_ENV_FPGA OR CONFIG_ESP_BRINGUP_BYPASS_CPU_CLK_SETTING)
2021-01-26 05:12:54 +00:00
list(APPEND srcs "fpga_overrides.c")
endif()
if(BOOTLOADER_BUILD)
# "_esp_error_check_failed()" requires spi_flash module
# Bootloader relies on some Kconfig options defined in esp_system.
idf_component_register(SRCS "${srcs}" REQUIRES spi_flash)
else()
2021-02-23 12:06:41 +00:00
list(APPEND srcs "crosscore_int.c"
"esp_ipc.c"
2021-02-23 12:06:41 +00:00
"esp_err.c"
"freertos_hooks.c"
"int_wdt.c"
"panic.c"
2021-03-11 01:48:30 +00:00
"esp_system.c"
"startup.c"
"system_time.c"
"stack_check.c"
"ubsan.c"
"xt_wdt.c"
"debug_stubs.c")
2021-01-26 02:48:12 +00:00
if(CONFIG_ESP_TASK_WDT_EN)
list(APPEND srcs "task_wdt/task_wdt.c")
if(CONFIG_ESP_TASK_WDT_USE_ESP_TIMER)
list(APPEND srcs "task_wdt/task_wdt_impl_esp_timer.c")
else()
list(APPEND srcs "task_wdt/task_wdt_impl_timergroup.c")
endif()
endif()
if(CONFIG_ESP_SYSTEM_USE_EH_FRAME)
list(APPEND srcs "eh_frame_parser.c")
endif()
2022-08-29 09:59:11 +00:00
if(CONFIG_SOC_SYSTIMER_SUPPORT_ETM)
list(APPEND srcs "systick_etm.c")
endif()
if(CONFIG_ESP_SYSTEM_HW_STACK_GUARD)
list(APPEND srcs "hw_stack_guard.c")
endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS include
PRIV_REQUIRES spi_flash esp_timer esp_mm
# [refactor-todo] requirements due to init code,
# should be removable once using component init functions
# link-time registration is used.
# [refactor-todo] requires "driver" for headers:
# - spi_common_internal.h
# [refactor-todo] esp_partition required for virtual efuse
# init code. Move to esp_efuse component.
pthread bootloader_support efuse driver esp_partition
LDFRAGMENTS "linker.lf" "app.lf")
add_subdirectory(port)
# After system initialization, `start_app` (and its other cores variant) is called.
# This is provided by the user or from another component. Since we can't establish
# dependency on what we don't know, force linker to not drop the symbol regardless
# of link line order.
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app")
if(NOT CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app_other_cores")
endif()
# Disable stack protection in files which are involved in initialization of that feature
set_source_files_properties(
"startup.c" "stack_check.c"
PROPERTIES COMPILE_FLAGS
-fno-stack-protector)
2021-04-08 02:27:21 +00:00
include(${CMAKE_CURRENT_LIST_DIR}/ld/ld.cmake)
endif()
2021-01-26 05:12:54 +00:00
if(CONFIG_IDF_ENV_FPGA OR CONFIG_ESP_BRINGUP_BYPASS_CPU_CLK_SETTING)
2021-01-26 05:12:54 +00:00
# Forces the linker to include fpga stubs from this component
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_common_include_fpga_overrides")
endif()
# Force linking UBSAN hooks. If UBSAN is not enabled, the hooks will ultimately be removed
# due to -ffunction-sections -Wl,--gc-sections options.
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __ubsan_include")
# [refactor-todo] requirements due to init code, should be removable
# once link-time registration of component init functions is used.
if(CONFIG_APPTRACE_ENABLE)
idf_component_optional_requires(PRIVATE app_trace)
endif()
if(CONFIG_ESP_COREDUMP_ENABLE)
idf_component_optional_requires(PRIVATE espcoredump)
endif()
# [refactor-todo] requirement from the panic handler,
# need to introduce panic "event" concept to remove this dependency (IDF-2194)
idf_component_optional_requires(PRIVATE esp_gdbstub)
if(NOT CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT)
idf_component_optional_requires(PRIVATE esp_app_format)
endif()
if(CONFIG_PM_ENABLE)
idf_component_optional_requires(PRIVATE pm)
endif()
if(CONFIG_VFS_SUPPORT_IO)
idf_component_optional_requires(PRIVATE vfs)
endif()
if(CONFIG_SW_COEXIST_ENABLE OR CONFIG_EXTERNAL_COEX_ENABLE)
idf_component_optional_requires(PRIVATE esp_coex)
endif()
2022-05-11 02:32:56 +00:00
if(NOT BOOTLOADER_BUILD)
if(CONFIG_SPIRAM)
idf_component_optional_requires(PRIVATE esp_psram)
endif()
endif()