1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-17 09:13:45 +01:00

Build with C++17 (#8603)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jimmy Hedman
2025-06-14 15:21:39 +02:00
committed by GitHub
parent 92ea697119
commit ee37d2f9c8
9 changed files with 103 additions and 1 deletions

View File

@@ -507,6 +507,8 @@ class EsphomeCore:
self.libraries: list[Library] = []
# A set of build flags to set in the platformio project
self.build_flags: set[str] = set()
# A set of build unflags to set in the platformio project
self.build_unflags: set[str] = set()
# A set of defines to set for the compile process in esphome/core/defines.h
self.defines: set[Define] = set()
# A map of all platformio options to apply
@@ -545,6 +547,7 @@ class EsphomeCore:
self.global_statements = []
self.libraries = []
self.build_flags = set()
self.build_unflags = set()
self.defines = set()
self.platformio_options = {}
self.loaded_integrations = set()
@@ -766,11 +769,15 @@ class EsphomeCore:
self.libraries.append(library)
return library
def add_build_flag(self, build_flag):
def add_build_flag(self, build_flag: str) -> str:
self.build_flags.add(build_flag)
_LOGGER.debug("Adding build flag: %s", build_flag)
return build_flag
def add_build_unflag(self, build_unflag: str) -> None:
self.build_unflags.add(build_unflag)
_LOGGER.debug("Adding build unflag: %s", build_unflag)
def add_define(self, define):
if isinstance(define, str):
define = Define(define)