Skip to content

Commit 0034c9b

Browse files
committed
Add C++ flags for C++ only
1 parent de98500 commit 0034c9b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

platformio.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ build_flags =
1717
-std=c++2a
1818
-std=gnu++2a
1919
-fno-exceptions
20-
-fno-rtti
21-
-fno-threadsafe-statics
2220
-DCONFIG_ASYNC_TCP_QUEUE_SIZE=256
2321
build_unflags =
2422
-std=gnu++11
@@ -28,6 +26,7 @@ build_src_flags =
2826
-Wall
2927
-Wextra
3028
;-Wpedantic
29+
;-Werror
3130
;-Wcast-align
3231
;-Wcast-qual
3332
;-Wctor-dtor-privacy
@@ -48,9 +47,9 @@ build_src_flags =
4847
-Wstrict-overflow=5
4948
-Wswitch-default
5049
;-Wundef
51-
;-Werror
5250
-Wno-unused
5351
-Wno-unknown-pragmas
52+
;-Weffc++
5453

5554
lib_deps =
5655
https://github.com/google/flatbuffers#8b02fe6178427b96aea25396b53ea4ae8cadd7d8

scripts/embed_env_vars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ def print_dump(name: str, map: Mapping[str, str | int | bool]) -> None:
245245
cpp_defines = serialize_cpp_defines(cpp_defines)
246246

247247
print('Build type: ' + pio_build_type)
248-
print('Build defines: ' + str(cpp_defines))
249248

250249
# Set PIO variables.
251250
env['BUILD_TYPE'] = pio_build_type
252251
env['BUILD_FLAGS'] = remaining_build_flags
253252
env.Append(CPPDEFINES=list(cpp_defines.items()))
253+
env.Append(CXXFLAGS=['-fno-rtti', '-fno-threadsafe-statics', '-fno-use-cxa-atexit'])
254254

255255
# Rename the firmware.bin to app.bin.
256256
env.Replace(PROGNAME='app')

0 commit comments

Comments
 (0)