mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 14:16:40 +00:00
Improve on C++17 (#9170)
This commit is contained in:
parent
ac9c608542
commit
c81dbf9d59
@ -41,6 +41,6 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
cg.add_build_flag("-DUSE_HOST")
|
cg.add_build_flag("-DUSE_HOST")
|
||||||
cg.add_define("USE_ESPHOME_HOST_MAC_ADDRESS", config[CONF_MAC_ADDRESS].parts)
|
cg.add_define("USE_ESPHOME_HOST_MAC_ADDRESS", config[CONF_MAC_ADDRESS].parts)
|
||||||
cg.add_build_flag("-std=c++17")
|
cg.add_build_flag("-std=gnu++17")
|
||||||
cg.add_define("ESPHOME_BOARD", "host")
|
cg.add_define("ESPHOME_BOARD", "host")
|
||||||
cg.add_platformio_option("platform", "platformio/native")
|
cg.add_platformio_option("platform", "platformio/native")
|
||||||
|
@ -616,6 +616,12 @@ def add_build_unflag(build_unflag: str) -> None:
|
|||||||
def set_cpp_standard(standard: str) -> None:
|
def set_cpp_standard(standard: str) -> None:
|
||||||
"""Set C++ standard with compiler flag `-std={standard}`."""
|
"""Set C++ standard with compiler flag `-std={standard}`."""
|
||||||
CORE.add_build_unflag("-std=gnu++11")
|
CORE.add_build_unflag("-std=gnu++11")
|
||||||
|
CORE.add_build_unflag("-std=gnu++14")
|
||||||
|
CORE.add_build_unflag("-std=gnu++20")
|
||||||
|
CORE.add_build_unflag("-std=gnu++23")
|
||||||
|
CORE.add_build_unflag("-std=gnu++2a")
|
||||||
|
CORE.add_build_unflag("-std=gnu++2b")
|
||||||
|
CORE.add_build_unflag("-std=gnu++2c")
|
||||||
CORE.add_build_flag(f"-std={standard}")
|
CORE.add_build_flag(f"-std={standard}")
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,6 +50,12 @@ build_flags =
|
|||||||
-std=gnu++17
|
-std=gnu++17
|
||||||
build_unflags =
|
build_unflags =
|
||||||
-std=gnu++11
|
-std=gnu++11
|
||||||
|
-std=gnu++14
|
||||||
|
-std=gnu++20
|
||||||
|
-std=gnu++23
|
||||||
|
-std=gnu++2a
|
||||||
|
-std=gnu++2b
|
||||||
|
-std=gnu++2c
|
||||||
src_filter =
|
src_filter =
|
||||||
+<./>
|
+<./>
|
||||||
+<../tests/dummy_main.cpp>
|
+<../tests/dummy_main.cpp>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user