[Tools]fix GCC7 in MacOSX
This commit is contained in:
parent
a1eccf0e57
commit
a37ffb1b28
|
@ -1,5 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import platform
|
||||||
|
|
||||||
def GetGCCRoot(rtconfig):
|
def GetGCCRoot(rtconfig):
|
||||||
exec_path = rtconfig.EXEC_PATH
|
exec_path = rtconfig.EXEC_PATH
|
||||||
|
@ -59,7 +60,11 @@ def GCCResult(rtconfig, str):
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# '-fdirectives-only',
|
# '-fdirectives-only',
|
||||||
|
if(platform.system() == 'Windows'):
|
||||||
child = subprocess.Popen([gcc_cmd, '-E', '-P', '__tmp.c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
child = subprocess.Popen([gcc_cmd, '-E', '-P', '__tmp.c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
|
else:
|
||||||
|
child = subprocess.Popen(gcc_cmd + ' -E -P __tmp.c', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
|
|
||||||
stdout, stderr = child.communicate()
|
stdout, stderr = child.communicate()
|
||||||
|
|
||||||
print(stdout)
|
print(stdout)
|
||||||
|
|
Loading…
Reference in New Issue