1idf_build_get_property(target IDF_TARGET)
2
3idf_component_register(SRCS "src/gdbstub.c" "src/packet.c"
4                       INCLUDE_DIRS "include"
5                       PRIV_INCLUDE_DIRS "private_include"
6                       LDFRAGMENTS "linker.lf"
7                       REQUIRES "freertos"
8                       PRIV_REQUIRES "soc" "esp_rom")
9
10if(CONFIG_IDF_TARGET_ARCH_XTENSA)
11    target_include_directories(${COMPONENT_LIB} PUBLIC "xtensa" "${target}")
12    target_sources(${COMPONENT_LIB} PRIVATE "xtensa/gdbstub_xtensa.c"
13                                            "xtensa/gdbstub-entry.S"
14                                            "esp_common/gdbstub_common.c")
15
16elseif(CONFIG_IDF_TARGET_ARCH_RISCV)
17    target_include_directories(${COMPONENT_LIB} PUBLIC "riscv" "${target}")
18    target_sources(${COMPONENT_LIB} PRIVATE "riscv/gdbstub_riscv.c"
19    "${target}/gdbstub_${target}.c")
20endif()
21