Skip to content

Commit

Permalink
Use C++14 when compiling CHIP for esp32.
Browse files Browse the repository at this point in the history
The ESP32 SDK automatically adds -std=-gnu++11 to CXXFLAGS (see
"make/project.mk" in the SDK).  So we just filter it out, and manually
add -std=gnu++14 instead.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 26, 2021
1 parent 28afa45 commit 521a5ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions config/esp32/components/chip/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ $(OUTPUT_DIR) :
fix_cflags = $(filter-out -DHAVE_CONFIG_H,\
$(filter-out -D,\
$(filter-out IDF_VER%,\
$(sort $(1)) -D$(filter IDF_VER%,$(1))\
)))
$(filter-out -std=gnu++11,\
$(sort $(1)) -D$(filter IDF_VER%,$(1))\
))))
CHIP_CFLAGS = $(call fix_cflags,$(CFLAGS) $(CPPFLAGS))
CHIP_CXXFLAGS = $(call fix_cflags,$(CXXFLAGS) $(CPPFLAGS))
CHIP_CXXFLAGS = $(call fix_cflags,$(CXXFLAGS) $(CPPFLAGS)) -std=gnu++14

install-chip : $(OUTPUT_DIR)
echo "INSTALL CHIP..."
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32
$(PROJECT_PATH)/../../common/QRCode \
$(PROJECT_PATH)/../../common/screen-framework \

CXXFLAGS += -std=c++11 -Os -DLWIP_IPV6_SCOPES=0
CXXFLAGS += -std=c++14 -Os -DLWIP_IPV6_SCOPES=0
CPPFLAGS += -Os -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H
CFLAGS += -Os -DLWIP_IPV6_SCOPES=0

Expand Down
2 changes: 1 addition & 1 deletion examples/temperature-measurement-app/esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32
$(PROJECT_PATH)/../../common/QRCode \
$(PROJECT_PATH)/../../common/screen-framework \

CXXFLAGS += -std=c++11 -Os -DLWIP_IPV6_SCOPES=0
CXXFLAGS += -std=c++14 -Os -DLWIP_IPV6_SCOPES=0
CPPFLAGS += -Os -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H
CFLAGS += -Os -DLWIP_IPV6_SCOPES=0

Expand Down

0 comments on commit 521a5ee

Please sign in to comment.