mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
clean up code
This commit is contained in:
parent
05f3b71007
commit
6e2d8cffaf
1 changed files with 2 additions and 10 deletions
|
@ -166,11 +166,9 @@ int main() { return 0;}
|
|||
zephyr_dir = Path(build_dir / "zephyr")
|
||||
zephyr_dir.mkdir(exist_ok=True)
|
||||
Path(zephyr_dir / "prj.conf").write_text("", encoding="utf-8")
|
||||
result = subprocess.run(
|
||||
subprocess.run(
|
||||
["pio", "run", "-e", build_environment, "-d", build_dir], check=False
|
||||
)
|
||||
if result.returncode != 0:
|
||||
print("Unable to compile empty main to build env")
|
||||
|
||||
def extract_include_paths(command):
|
||||
include_paths = []
|
||||
|
@ -180,9 +178,6 @@ int main() { return 0;}
|
|||
return include_paths
|
||||
|
||||
def extract_defines(command):
|
||||
"""
|
||||
Extracts defined macros from the command string.
|
||||
"""
|
||||
defines = []
|
||||
define_pattern = re.compile(r"-D\s*([^\s]+)")
|
||||
for match in define_pattern.findall(command):
|
||||
|
@ -194,7 +189,6 @@ int main() { return 0;}
|
|||
command = entry["command"]
|
||||
cxx_path = command.split()[0]
|
||||
return cxx_path
|
||||
raise ValueError("No valid compiler path found in the compile commands")
|
||||
|
||||
def get_builtin_include_paths(compiler):
|
||||
result = subprocess.run(
|
||||
|
@ -217,10 +211,8 @@ int main() { return 0;}
|
|||
return include_paths
|
||||
|
||||
def extract_cxx_flags(command):
|
||||
"""
|
||||
Extracts CXXFLAGS from the command string, excluding includes and defines.
|
||||
"""
|
||||
flags = []
|
||||
# Extracts CXXFLAGS from the command string, excluding includes and defines.
|
||||
flag_pattern = re.compile(
|
||||
r"(-O[0-3s]|-g|-std=[^\s]+|-Wall|-Wextra|-Werror|--[^\s]+|-f[^\s]+|-m[^\s]+|-imacros\s*[^\s]+)"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue