summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-05-17 23:40:15 +0800
committerGitHub <[email protected]>2018-05-17 23:40:15 +0800
commit82b30a4bdc187a3ef488157426a1434634ef5d8b (patch)
tree32e12e85610a0e2c5db7d2604f5f88fdd1c1d5fc
parent28ba8cbaa9ea761766b8f4939737dbc37024a823 (diff)
parenta37ffb1b28c5c051a7643f05333011d40119697f (diff)
Merge pull request #1445 from uestczyh222/master
[Tools]fix GCC7 in MacOSX
-rw-r--r--tools/gcc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/gcc.py b/tools/gcc.py
index bfa0ca4173..b977f183f7 100644
--- a/tools/gcc.py
+++ b/tools/gcc.py
@@ -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)