提交 2788a036 authored 作者: Frederic's avatar Frederic

Fix the new march=native on windows.

上级 a1a03e58
...@@ -1485,8 +1485,8 @@ def gcc_llvm(): ...@@ -1485,8 +1485,8 @@ def gcc_llvm():
p = None p = None
try: try:
p = call_subprocess_Popen(['g++', '--version'], p = call_subprocess_Popen(['g++', '--version'],
stdout=subprocess.PIPE,
stdin=dummy_in.fileno(), stdin=dummy_in.fileno(),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
p.wait() p.wait()
output = p.stdout.read() + p.stderr.read() output = p.stdout.read() + p.stderr.read()
...@@ -1546,10 +1546,16 @@ class GCC_compiler(object): ...@@ -1546,10 +1546,16 @@ class GCC_compiler(object):
GCC_compiler.march_flags = [] GCC_compiler.march_flags = []
def get_lines(cmd, parse=True): def get_lines(cmd, parse=True):
dummy_in = open(os.devnull)
try:
p = call_subprocess_Popen(cmd, p = call_subprocess_Popen(cmd,
stdin=dummy_in.fileno(),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
stdout=subprocess.PIPE, shell=True) shell=True)
p.wait() p.wait()
finally:
del dummy_in
stdout = p.stdout.readlines() stdout = p.stdout.readlines()
stderr = p.stderr.readlines() stderr = p.stderr.readlines()
lines = [] lines = []
...@@ -1566,7 +1572,7 @@ class GCC_compiler(object): ...@@ -1566,7 +1572,7 @@ class GCC_compiler(object):
lines = stdout + stderr lines = stdout + stderr
return lines return lines
native_lines = get_lines("g++ -march=native -E -v - </dev/null") native_lines = get_lines("g++ -march=native -E -v -")
_logger.info("g++ -march=native selected lines: %s", native_lines) _logger.info("g++ -march=native selected lines: %s", native_lines)
if len(native_lines) != 1: if len(native_lines) != 1:
_logger.warn( _logger.warn(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论