set(FETCHCONTENT_BASE_DIR "${CMAKE_SOURCE_DIR}/build/.cmake_fetch_cache")

include($ENV{SCARGO_PROJECT_ROOT}/third-party/stm32-cmake/cmake/stm32_gcc.cmake)

stm32_get_chip_info($ENV{STM32_CHIP} FAMILY STM32_FAMILY DEVICE STM32_DEVICE TYPE STM32_TYPE)

message("Fetching stm32 cube for stm32 ${STM32_FAMILY} family")
stm32_fetch_cube(${STM32_FAMILY})

add_compile_options(--specs=nosys.specs)
add_link_options(--specs=nosys.specs)
link_libraries(STM32::${STM32_FAMILY})
