Enable various compilation flags to reduce the binary size (#401)

* Add the following compilation flags:
 * -fno-exceptions and -fno-non-call-exceptions : disable exception handling
 * -fno-rtti : disable run time type information (needed by dynamic_cast, for example)

These flags reduce the binary size by about 100KB!

Also, -fstack-usage generate debug info (not in final binary) to allow tools like Puncover to do a stack analysis.

* Remove unused CMake variables in CMake_nRF5x.cmake (duplicated in src/CMakeLists.txt).
Replace -O0 by -Og in DEBUG builds. This generates a smaller binary (small enough for the internal memory) that is debugger friendly.
This commit is contained in:
JF002
2021-06-01 21:03:01 +02:00
committed by GitHub
parent c0b0f8cb73
commit 1b6acdedc2
3 changed files with 38 additions and 53 deletions

View File

@@ -153,7 +153,7 @@ void DisplayApp::Refresh() {
break;
case Messages::TimerDone:
if (currentApp == Apps::Timer) {
auto *timer = dynamic_cast<Screens::Timer*>(currentScreen.get());
auto *timer = static_cast<Screens::Timer*>(currentScreen.get());
timer->setDone();
} else {
LoadApp(Apps::Timer, DisplayApp::FullRefreshDirections::Down);