xtensa: simplify build script

This commit is contained in:
Renz Bagaporo
2021-01-22 23:06:37 +08:00
parent 1efdcd69d9
commit d920aa52be
2 changed files with 11 additions and 16 deletions

View File

@@ -1,7 +1,9 @@
idf_build_get_property(target IDF_TARGET) idf_build_get_property(target IDF_TARGET)
if(NOT "${target}" STREQUAL "esp32c3") if(NOT "${target}" STREQUAL "esp32c3")
return() return()
endif() endif()
if(BOOTLOADER_BUILD) if(BOOTLOADER_BUILD)
set(priv_requires soc) set(priv_requires soc)
else() else()

View File

@@ -1,24 +1,17 @@
idf_build_get_property(target IDF_TARGET) idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "esp32c3")
if("${target}" STREQUAL "esp32c3")
return() return()
endif() endif()
if(BOOTLOADER_BUILD)
# bootloader only needs headers from this component set(srcs "eri.c" "xt_trax.c")
set(priv_requires soc)
else() if(NOT BOOTLOADER_BUILD)
set(priv_requires soc freertos) list(APPEND srcs "xtensa_intr.c" "xtensa_intr_asm.S")
set(srcs "eri.c"
"xt_trax.c"
"xtensa_intr.c"
"xtensa_intr_asm.S"
)
endif() endif()
idf_component_register(SRCS ${srcs} idf_component_register(SRCS ${srcs}
INCLUDE_DIRS include ${target}/include INCLUDE_DIRS include ${target}/include
LDFRAGMENTS linker.lf LDFRAGMENTS linker.lf)
PRIV_REQUIRES ${priv_requires})
if(NOT BOOTLOADER_BUILD) target_link_libraries(${COMPONENT_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${target}/libxt_hal.a")
target_link_libraries(${COMPONENT_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${target}/libxt_hal.a")
endif()