mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
refactoring
This commit is contained in:
parent
59b943aad0
commit
e163b9659a
3 changed files with 5 additions and 5 deletions
|
@ -36,7 +36,7 @@ from esphome.cpp_generator import ( # noqa
|
|||
get_variable,
|
||||
get_variable_with_full_id,
|
||||
process_lambda,
|
||||
set_cpp_version,
|
||||
set_cpp_standard,
|
||||
is_template,
|
||||
templatable,
|
||||
MockObj,
|
||||
|
|
|
@ -362,7 +362,7 @@ CONFIG_SCHEMA = cv.All(
|
|||
|
||||
async def to_code(config):
|
||||
cg.add_platformio_option("board", config[CONF_BOARD])
|
||||
cg.set_cpp_version("gnu++17")
|
||||
cg.set_cpp_standard("gnu++17")
|
||||
cg.add_build_flag("-DUSE_ESP32")
|
||||
cg.add_define("ESPHOME_BOARD", config[CONF_BOARD])
|
||||
cg.add_build_flag(f"-DUSE_ESP32_VARIANT_{config[CONF_VARIANT]}")
|
||||
|
|
|
@ -610,10 +610,10 @@ def add_build_unflag(build_unflag: str):
|
|||
CORE.add_build_unflag(build_unflag)
|
||||
|
||||
|
||||
def set_cpp_version(version: str):
|
||||
"""Set C++ version via compiler flag `-std={version}`."""
|
||||
def set_cpp_standard(standard: str):
|
||||
"""Set C++ standard with compiler flag `-std={standard}`."""
|
||||
CORE.add_build_unflag("-std=gnu++11")
|
||||
CORE.add_build_flag(f"-std={version}")
|
||||
CORE.add_build_flag(f"-std={standard}")
|
||||
|
||||
|
||||
def add_define(name: str, value: SafeExpType = None):
|
||||
|
|
Loading…
Reference in a new issue