瀏覽代碼

Adds support for the Newlib-Nano Standard Library

- For MCUs with very little flash, the Nano library is more suitable.
- This change supports building with the GCC nano stdlib, simply by
  linking STM32::Nano library in cmake.
Clemens Zangl 5 年之前
父節點
當前提交
d16a54b685
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      cmake/stm32/common.cmake

+ 6 - 0
cmake/stm32/common.cmake

@@ -230,6 +230,12 @@ if(NOT (TARGET STM32::NoSys))
     target_link_options(STM32::NoSys INTERFACE $<$<C_COMPILER_ID:GNU>:--specs=nosys.specs>)
 endif()
 
+if(NOT (TARGET STM32::Nano))
+    add_library(STM32::Nano INTERFACE IMPORTED)
+    target_compile_options(STM32::Nano INTERFACE $<$<C_COMPILER_ID:GNU>:--specs=nano.specs>)
+    target_link_options(STM32::Nano INTERFACE $<$<C_COMPILER_ID:GNU>:--specs=nano.specs>)
+endif()
+
 include(stm32/utilities)
 include(stm32/f0)
 include(stm32/f1)