mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 00:51:49 +00:00 
			
		
		
		
	[core] Don't issue -Wno-volatile for host platform (#9511)
This commit is contained in:
		
				
					committed by
					
						
						Jesse Hills
					
				
			
			
				
	
			
			
			
						parent
						
							786cb7ded5
						
					
				
				
					commit
					9bc3ff5f53
				
			@@ -163,7 +163,7 @@ def get_ini_content():
 | 
				
			|||||||
    CORE.add_platformio_option("build_unflags", sorted(CORE.build_unflags))
 | 
					    CORE.add_platformio_option("build_unflags", sorted(CORE.build_unflags))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Add extra script for C++ flags
 | 
					    # 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 = "[platformio]\n"
 | 
				
			||||||
    content += f"description = ESPHome {__version__}\n"
 | 
					    content += f"description = ESPHome {__version__}\n"
 | 
				
			||||||
@@ -402,14 +402,18 @@ def write_gitignore():
 | 
				
			|||||||
            f.write(GITIGNORE_CONTENT)
 | 
					            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")
 | 
					Import("env")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Add C++ specific warning flags
 | 
					# Add C++ specific flags
 | 
				
			||||||
env.Append(CXXFLAGS=["-Wno-volatile"])
 | 
					 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def write_cxx_flags_script() -> None:
 | 
					def write_cxx_flags_script() -> None:
 | 
				
			||||||
    path = CORE.relative_build_path("cxx_flags.py")
 | 
					    path = CORE.relative_build_path(CXX_FLAGS_FILE_NAME)
 | 
				
			||||||
    write_file_if_changed(path, CXX_FLAGS_SCRIPT)
 | 
					    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