# Add set(CONFIG_USE_device_LPC804_startup true) in config.cmake to use this component

include_guard(GLOBAL)
message("${CMAKE_CURRENT_LIST_FILE} component is included.")

if(CONFIG_USE_device_LPC804_system)

if(CONFIG_TOOLCHAIN STREQUAL armgcc)
  target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
      ${CMAKE_CURRENT_LIST_DIR}/gcc/startup_LPC804.S
  )
endif()

if(CONFIG_TOOLCHAIN STREQUAL mcux)
  target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
      ${CMAKE_CURRENT_LIST_DIR}/mcuxpresso/startup_lpc804.c
      ${CMAKE_CURRENT_LIST_DIR}/mcuxpresso/startup_lpc804.cpp
  )
endif()

if(CONFIG_TOOLCHAIN STREQUAL iar)
  add_config_file(${CMAKE_CURRENT_LIST_DIR}/iar/startup_LPC804.s "" device_LPC804_startup.LPC804)
endif()

if(CONFIG_TOOLCHAIN STREQUAL mdk)
  add_config_file(${CMAKE_CURRENT_LIST_DIR}/arm/startup_LPC804.S "" device_LPC804_startup.LPC804)
endif()

else()

message(SEND_ERROR "device_LPC804_startup.LPC804 dependency does not meet, please check ${CMAKE_CURRENT_LIST_FILE}.")

endif()
