-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for the Newlib-Nano Standard Library #179
Conversation
- 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.
Great contribution, can you add this modification to the Readme.md file too? An undocumented feature is no feature at all 😄 |
There must be a way to check that we are not trying to link both STM32::NoSys STM32::Nano, since those does not make sense together.
|
cmake/stm32/common.cmake
Outdated
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() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() | |
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>) | |
#This custom property is used to check that specs is not set yet on a target linking to this one | |
set_property(TARGET STM32::Nano PROPERTY INTERFACE_CUSTOM_GCC_SPECS "NANO") | |
set_property(TARGET STM32::Nano APPEND PROPERTY | |
COMPATIBLE_INTERFACE_STRING CUSTOM_GCC_SPECS) | |
endif() | |
You must change the way NoSys is handle as well.
|
- Readme file is updated to provide more details on the NoSys and Nano libraries. - A check was added to avoid linking both STM32::NoSys and STM32::Nano libraries.
@Hish15 Thank you. I updated the branch according to your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good to me 😄
linking STM32::Nano library in cmake.