mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	[core] Don't issue -Wno-volatile for host platform (#9511)
This commit is contained in:
		| @@ -163,7 +163,7 @@ def get_ini_content(): | ||||
|     CORE.add_platformio_option("build_unflags", sorted(CORE.build_unflags)) | ||||
|  | ||||
|     # Add extra script for C++ flags | ||||
|     CORE.add_platformio_option("extra_scripts", ["pre:cxx_flags.py"]) | ||||
|     CORE.add_platformio_option("extra_scripts", [f"pre:{CXX_FLAGS_FILE_NAME}"]) | ||||
|  | ||||
|     content = "[platformio]\n" | ||||
|     content += f"description = ESPHome {__version__}\n" | ||||
| @@ -402,14 +402,18 @@ def write_gitignore(): | ||||
|             f.write(GITIGNORE_CONTENT) | ||||
|  | ||||
|  | ||||
| CXX_FLAGS_SCRIPT = """# Auto-generated ESPHome script for C++ specific compiler flags | ||||
| CXX_FLAGS_FILE_NAME = "cxx_flags.py" | ||||
| CXX_FLAGS_FILE_CONTENTS = """# Auto-generated ESPHome script for C++ specific compiler flags | ||||
| Import("env") | ||||
|  | ||||
| # Add C++ specific warning flags | ||||
| env.Append(CXXFLAGS=["-Wno-volatile"]) | ||||
| # Add C++ specific flags | ||||
| """ | ||||
|  | ||||
|  | ||||
| def write_cxx_flags_script() -> None: | ||||
|     path = CORE.relative_build_path("cxx_flags.py") | ||||
|     write_file_if_changed(path, CXX_FLAGS_SCRIPT) | ||||
|     path = CORE.relative_build_path(CXX_FLAGS_FILE_NAME) | ||||
|     contents = CXX_FLAGS_FILE_CONTENTS | ||||
|     if not CORE.is_host: | ||||
|         contents += 'env.Append(CXXFLAGS=["-Wno-volatile"])' | ||||
|         contents += "\n" | ||||
|     write_file_if_changed(path, contents) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user