提交 29757d4f authored 作者: Ben Mares's avatar Ben Mares 提交者: Michael Osthege

Define get_lines outside of the if statement

That's the only possible definition, and the type checker is freaking out.
上级 e602c239
...@@ -2104,9 +2104,6 @@ class GCC_compiler(Compiler): ...@@ -2104,9 +2104,6 @@ class GCC_compiler(Compiler):
) )
detect_march = False detect_march = False
if detect_march:
GCC_compiler.march_flags = []
def get_lines(cmd, parse=True): def get_lines(cmd, parse=True):
p = subprocess_Popen( p = subprocess_Popen(
cmd, cmd,
...@@ -2144,6 +2141,9 @@ class GCC_compiler(Compiler): ...@@ -2144,6 +2141,9 @@ class GCC_compiler(Compiler):
return lines return lines
if detect_march:
GCC_compiler.march_flags = []
# The '-' at the end is needed. Otherwise, g++ do not output # The '-' at the end is needed. Otherwise, g++ do not output
# enough information. # enough information.
native_lines = get_lines(f"{config.cxx} -march=native -E -v -") native_lines = get_lines(f"{config.cxx} -march=native -E -v -")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论