
cmake_minimum_required(VERSION 3.15)
project(bsp)
find_package(common)
find_package(commonmeta)
if(CMAKE_EXPORT_COMPILE_COMMANDS)
    set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
    set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
endif()

ADD_DEFINITIONS(-c ${proc_extra_compiler_flags})
include_directories(${CMAKE_BINARY_DIR}/include)
include_directories(${CMAKE_INCLUDE_PATH})

if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeRTOS")
add_compile_definitions(FREERTOS_BSP)
endif()
if (EXISTS ${metal_BINARY_DIR})
include_directories(${metal_BINARY_DIR}/lib/include)
endif()
set (BSP_LIBSRC_SUBDIRS libsrc standalone xiltimer)

if (SUBDIR_LIST STREQUAL "ALL")
    set (SUBDIR_LIST ${BSP_LIBSRC_SUBDIRS})
endif()

foreach(entry ${SUBDIR_LIST})
    if(entry STREQUAL "libsrc")
        set (path "${CMAKE_LIBRARY_PATH}/../libsrc")
    else()
        set (path "${CMAKE_LIBRARY_PATH}/../libsrc/${entry}/src")
    endif()
    if(EXISTS ${path})
        add_subdirectory(${path})
    endif()
endforeach()
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL _my_hook_end_of_configure())
function(_my_hook_end_of_configure)
    set(SUBDIR_LIST "ALL" CACHE STRING "sub dir list" FORCE)
endfunction(_my_hook_end_of_configure)
    
//<copyright-disclaimer-start>
//  **************************************************************************************************************
//  * © 2026 Advanced Micro Devices, Inc. All rights reserved.                                                  *
//  * DISCLAIMER                                                                                                 *
//  * The information contained herein is for informational purposes only, and is subject to change              *
//  * without notice. While every precaution has been taken in the preparation of this document, it              *
//  * may contain technical inaccuracies, omissions and typographical errors, and AMD is under no                *
//  * obligation to update or otherwise correct this information.  Advanced Micro Devices, Inc. makes            *
//  * no representations or warranties with respect to the accuracy or completeness of the contents of           *
//  * this document, and assumes no liability of any kind, including the implied warranties of noninfringement,  *
//  * merchantability or fitness for particular purposes, with respect to the operation or use of AMD            *
//  * hardware, software or other products described herein.  No license, including implied or                   *
//  * arising by estoppel, to any intellectual property rights is granted by this document.  Terms and           *
//  * limitations applicable to the purchase or use of AMD’s products are as set forth in a signed agreement   *
//  * between the parties or in AMD's Standard Terms and Conditions of Sale. GD-18                               *
//  *                                                                                                            *
//  **************************************************************************************************************
//<copyright-disclaimer-end>