Skip to content

Commit

Permalink
Dynamically configure exceptions support (#7834)
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros authored Jan 22, 2021
1 parent 2402958 commit 11a2fb3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def scons_patched_match_splitext(path, suffixes=None):
"-U__STRICT_ANSI__",
"-ffunction-sections",
"-fdata-sections",
"-fno-exceptions",
"-Wall"
],

Expand Down Expand Up @@ -130,7 +129,7 @@ def scons_patched_match_splitext(path, suffixes=None):
LIBS=[
"hal", "phy", "pp", "net80211", "wpa", "crypto", "main",
"wps", "bearssl", "espnow", "smartconfig", "airkiss", "wpa2",
"stdc++", "m", "c", "gcc"
"m", "c", "gcc"
],

LIBSOURCE_DIRS=[
Expand Down Expand Up @@ -250,6 +249,20 @@ def scons_patched_match_splitext(path, suffixes=None):
env.Append(CPPDEFINES=[("WAVEFORM_LOCKED_PHASE", 1)])
# PIO_FRAMEWORK_ARDUINO_WAVEFORM_LOCKED_PWM will be used by default

#
# Exceptions
#
if "PIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS" in flatten_cppdefines:
env.Append(
CXXFLAGS=["-fexceptions"],
LIBS=["stdc++-exc"]
)
else:
env.Append(
CXXFLAGS=["-fno-exceptions"],
LIBS=["stdc++"]
)

#
# VTables
#
Expand Down

0 comments on commit 11a2fb3

Please sign in to comment.