Merge pull request #1445 from uestczyh222/master

[Tools]fix GCC7 in MacOSX
This commit is contained in:
Bernard Xiong 2018-05-17 23:40:15 +08:00 committed by GitHub
commit 82b30a4bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import os
import re
import platform
def GetGCCRoot(rtconfig):
exec_path = rtconfig.EXEC_PATH
@ -59,7 +60,11 @@ def GCCResult(rtconfig, str):
f.close()
# '-fdirectives-only',
child = subprocess.Popen([gcc_cmd, '-E', '-P', '__tmp.c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
if(platform.system() == 'Windows'):
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()
print(stdout)