2019-08-08 00:00:45 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2020-07-29 10:03:46 -04:00
|
|
|
if(CONFIG_IDF_ENV_FPGA)
|
|
|
|
list(APPEND srcs "src/fpga_overrides.c")
|
|
|
|
endif()
|
|
|
|
|
2019-03-15 05:44:27 -04:00
|
|
|
if(BOOTLOADER_BUILD)
|
|
|
|
# For bootloader, all we need from esp_common is headers
|
2020-07-29 10:03:46 -04:00
|
|
|
idf_component_register(SRCS ${srcs}
|
|
|
|
INCLUDE_DIRS include
|
|
|
|
PRIV_REQUIRES soc)
|
2019-04-07 08:33:56 -04:00
|
|
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-Wl,--gc-sections")
|
2019-03-15 05:44:27 -04:00
|
|
|
else()
|
|
|
|
# Regular app build
|
2020-07-29 10:03:46 -04:00
|
|
|
list(APPEND srcs "src/brownout.c"
|
2020-02-02 10:18:29 -05:00
|
|
|
"src/esp_err.c"
|
2019-08-15 03:05:59 -04:00
|
|
|
"src/esp_err_to_name.c"
|
|
|
|
"src/freertos_hooks.c"
|
2019-10-29 23:19:22 -04:00
|
|
|
"src/mac_addr.c"
|
2019-12-26 03:30:03 -05:00
|
|
|
"src/stack_check.c"
|
|
|
|
"src/task_wdt.c"
|
|
|
|
"src/int_wdt.c")
|
2019-08-15 03:05:59 -04:00
|
|
|
|
2020-11-05 23:00:07 -05:00
|
|
|
if(NOT CONFIG_IDF_TARGET_ESP32C3)
|
|
|
|
list(APPEND srcs "src/dbg_stubs.c")
|
|
|
|
endif()
|
|
|
|
|
2020-07-21 05:15:19 -04:00
|
|
|
# Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
|
2019-08-15 03:05:59 -04:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2019-09-15 20:56:48 -04:00
|
|
|
INCLUDE_DIRS include
|
2020-09-30 03:24:04 -04:00
|
|
|
REQUIRES ${target} espcoredump esp_timer esp_ipc esp_pm esp_hw_support
|
2020-02-02 10:23:16 -05:00
|
|
|
PRIV_REQUIRES soc
|
|
|
|
LDFRAGMENTS "linker.lf")
|
2019-03-21 00:21:01 -04:00
|
|
|
|
2019-03-15 05:44:27 -04:00
|
|
|
set_source_files_properties(
|
|
|
|
"src/stack_check.c"
|
|
|
|
PROPERTIES COMPILE_FLAGS
|
|
|
|
-fno-stack-protector)
|
2020-07-21 06:11:22 -04:00
|
|
|
|
2019-04-07 08:33:56 -04:00
|
|
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_LIBRARIES "-Wl,--gc-sections")
|
|
|
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-Wl,--gc-sections")
|
2019-07-02 05:51:28 -04:00
|
|
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)
|
|
|
|
|
|
|
|
# List of components needed for the error codes list
|
|
|
|
set(optional_reqs ulp
|
|
|
|
efuse
|
|
|
|
esp_http_client
|
|
|
|
esp_http_server
|
|
|
|
bootloader_support
|
|
|
|
nvs_flash
|
|
|
|
esp_wifi
|
|
|
|
app_update
|
|
|
|
lwip
|
|
|
|
spi_flash
|
|
|
|
wpa_supplicant
|
2020-08-21 06:04:52 -04:00
|
|
|
tcpip_adapter
|
|
|
|
esp_serial_slave_link
|
|
|
|
esp_netif
|
|
|
|
soc
|
|
|
|
esp-tls
|
|
|
|
esp_https_ota)
|
2019-07-02 05:51:28 -04:00
|
|
|
|
|
|
|
idf_build_get_property(build_components BUILD_COMPONENTS)
|
|
|
|
foreach(req ${optional_reqs})
|
|
|
|
if(req IN_LIST build_components)
|
|
|
|
idf_component_get_property(req_lib ${req} COMPONENT_LIB)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PRIVATE ${req_lib})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2019-03-15 05:44:27 -04:00
|
|
|
endif()
|
2020-07-29 10:03:46 -04:00
|
|
|
|
|
|
|
if(CONFIG_IDF_ENV_FPGA)
|
|
|
|
# Forces the linker to include fpga stubs from this component
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_common_include_fpga_overrides")
|
|
|
|
endif()
|