1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +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

@@ -608,6 +608,17 @@ def add_build_flag(build_flag: str):
CORE.add_build_flag(build_flag)
def add_build_unflag(build_unflag: str) -> None:
"""Add a global build unflag to the compiler flags."""
CORE.add_build_unflag(build_unflag)
def set_cpp_standard(standard: str) -> None:
"""Set C++ standard with compiler flag `-std={standard}`."""
CORE.add_build_unflag("-std=gnu++11")
CORE.add_build_flag(f"-std={standard}")
def add_define(name: str, value: SafeExpType = None):
"""Add a global define to the auto-generated defines.h file.