# https://github.com/Infineon/mtb-example-xmc-flash-eeprom/tree/master/COMPONENT_CUSTOM_DESIGN_MODUS
xmc_check_bsp(
  KIT_XMC14_BOOT_001
  KIT_XMC47_RELAX_V1
)

project(flash-eeprom)

xmc_load_application(
  NAME mtb-example-xmc-flash-eeprom
  VERSION 1.0.1
)

xmc_add_executable(
  SOURCES
    ${APP_DIR}/source/main.c
    ${APP_DIR}/source/print_functions.h
    ${APP_DIR}/source/print_functions.c
    ${APP_DIR}/source/xmc1_e_eeprom.h
    ${APP_DIR}/source/xmc1_e_eeprom.c
    ${APP_DIR}/source/xmc1_e_eeprom_example.h
    ${APP_DIR}/source/xmc1_e_eeprom_example.c
    ${APP_DIR}/source/xmc4_e_eeprom.h
    ${APP_DIR}/source/xmc4_e_eeprom.c
    ${APP_DIR}/source/xmc4_e_eeprom_example.h
    ${APP_DIR}/source/xmc4_e_eeprom_example.c
  INCLUDE_DIRS
    ${APP_DIR}/source
  DESIGN_MODUS
    ${APP_DIR}/COMPONENT_CUSTOM_DESIGN_MODUS/TARGET_${BSP_NAME}/design.modus
)

# Enable VLA for IAR toolchain
if(${TOOLCHAIN} STREQUAL IAR)
  target_compile_options(${TARGET_NAME} PRIVATE "--vla")
endif()
