Target-specific cmake build?
Posted: Fri Dec 09, 2022 3:02 pm
Is it possible to add a component 'foo' only for ESP32 and exclude it from requirements if the target is set to ESP32-S3? Also include and exclude source files?
Code: Select all
#if CONFIG_IDF_TARGET_ESP32
file (GLOB SOURCES *.c)
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS "."
REQUIRES driver foo)
#else // S3
idf_component_register(SRCS "bar.c"
INCLUDE_DIRS "."
REQUIRES driver)
#endif