-
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
print binary size #182
print binary size #182
Conversation
cmake/stm32/common.cmake
Outdated
if(NOT STM32_TOOLCHAIN_PATH AND NOT CMAKE_C_COMPILER) | ||
set(STM32_TOOLCHAIN_PATH "/usr") | ||
message(STATUS "No STM32_TOOLCHAIN_PATH specified, using default: " ${STM32_TOOLCHAIN_PATH}) | ||
else() | ||
file(TO_CMAKE_PATH "${STM32_TOOLCHAIN_PATH}" STM32_TOOLCHAIN_PATH) | ||
if(NOT STM32_TOOLCHAIN_PATH) | ||
# keep only directory of compiler | ||
get_filename_component(STM32_TOOLCHAIN_PATH ${CMAKE_C_COMPILER} DIRECTORY) | ||
# remove the last /bin directory | ||
get_filename_component(STM32_TOOLCHAIN_PATH ${STM32_TOOLCHAIN_PATH} DIRECTORY) | ||
endif() | ||
file(TO_CMAKE_PATH "${STM32_TOOLCHAIN_PATH}" STM32_TOOLCHAIN_PATH) |
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.
The logic is confusing
if(not a && not b)
else() # if(a or b)
if(not a)
endif()
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.
I did my best. What do you propose ?
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.
What about :
if(not a && not b)
elseif(not a) # the `&& b` not needed but good too
endif()
file(TO_CMAKE_PATH "${STM32_TOOLCHAIN_PATH}" STM32_TOOLCHAIN_PATH)
I think doing the conversion TO_CMAKE_PATH
is good either way, so I took it out of the if blocks.
What do you think?
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.
What's good after 3 month is that I'm stranger to my code and can judge it better. Sorry for delay :)
closes #166
The function is called
stm32_print_size_of_target
I also added a small modification so that STM32_TOOLCHAIN_PATH could be set by CMAKE_C_COMPILER. As a VScode user, this is how the compiler is passed to cmake.