Skip to content

Commit 65913d8

Browse files
committed
ports/rp2: Add nano.specs snippet for C++ modules.
Document how to reemove C++ stack unwinding and exception handling. Set options as per https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_cxx_options/CMakeLists.txt Saves around 10,880 bytes of RAM in our batteries-included build. Signed-off-by: Phil Howard <phil@gadgetoid.com>
1 parent ee10360 commit 65913d8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/usercmodule/cppexample/micropython.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@ target_include_directories(usermod_cppexample INTERFACE
1414

1515
# Link our INTERFACE library to the usermod target.
1616
target_link_libraries(usermod INTERFACE usermod_cppexample)
17+
18+
# Do not include stack unwinding & exception handling for C++ user modules
19+
# This can dramatically reduce build size on embedded ports like rp2
20+
# target_compile_definitions(usermod INTERFACE PICO_CXX_ENABLE_EXCEPTIONS=0)
21+
# target_compile_options(usermod INTERFACE $<$<COMPILE_LANGUAGE:CXX>:
22+
# -fno-exceptions
23+
# -fno-unwind-tables
24+
# -fno-rtti
25+
# -fno-use-cxa-atexit
26+
# >)
27+
# target_link_options(usermod INTERFACE -specs=nano.specs)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy