# Copyright 2025 NXP
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
include(${SdkRootDirPath}/arch/arm/target/flash.cmake)
include(${SdkRootDirPath}/examples/_common/project_setting/arm_common.cmake)

## Custom board modules
if(CONFIG_MCUX_PRJSEG_module.custom_board.boardfile)
    mcux_add_source(SOURCES board.h board.c)
    mcux_add_include(INCLUDES .)
endif()

if(CONFIG_MCUX_PRJSEG_module.custom_board.clock)
    mcux_add_source(SOURCES clock_config.h clock_config.c)
    mcux_add_include(INCLUDES .)
endif()

if(CONFIG_MCUX_PRJSEG_module.custom_board.pinmux)
    mcux_add_source(
      SOURCES
        pin_mux.h
        pin_mux.c
    )
    mcux_add_include(INCLUDES .)
endif()

## Custom board project hardware_init.c/app.h
# Use PROJECT_NAME to distinguish between different projects
if(CONFIG_MCUX_PRJSEG_project.custom_board.hw_app)
  mcux_add_source(
    SOURCES examples/${PROJECT_NAME}/hardware_init.c
            examples/${PROJECT_NAME}/app.h
  )
  mcux_add_include(INCLUDES examples/${PROJECT_NAME})
endif()