From 521a5ee2eab122c0ef088175e09b27658dfe016f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 20 Jan 2021 11:59:01 -0500 Subject: [PATCH] Use C++14 when compiling CHIP for esp32. 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. --- config/esp32/components/chip/component.mk | 7 ++++--- examples/all-clusters-app/esp32/Makefile | 2 +- examples/temperature-measurement-app/esp32/Makefile | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/esp32/components/chip/component.mk b/config/esp32/components/chip/component.mk index 50ecc6fedf4cb9..81c4777d06cf8a 100644 --- a/config/esp32/components/chip/component.mk +++ b/config/esp32/components/chip/component.mk @@ -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..." diff --git a/examples/all-clusters-app/esp32/Makefile b/examples/all-clusters-app/esp32/Makefile index 69689a82e692a1..932134ecd45bbd 100644 --- a/examples/all-clusters-app/esp32/Makefile +++ b/examples/all-clusters-app/esp32/Makefile @@ -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 diff --git a/examples/temperature-measurement-app/esp32/Makefile b/examples/temperature-measurement-app/esp32/Makefile index 88502c0f08b0c7..ce4f9c52f659a1 100644 --- a/examples/temperature-measurement-app/esp32/Makefile +++ b/examples/temperature-measurement-app/esp32/Makefile @@ -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