소스 검색

[tools/gcc.py]fix scons error.

guozhanxin 1 년 전
부모
커밋
0b1a49ed66
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      tools/gcc.py

+ 4 - 0
tools/gcc.py

@@ -74,6 +74,10 @@ def GetGccDefaultSearchDirs(rtconfig):
     device_flags = rtconfig.DEVICE.split()
     args = [gcc_cmd] + device_flags + ['-xc', '-E', '-v', os.devnull]
 
+    # if gcc_cmd can not access , return empty list
+    if not os.access(gcc_cmd, os.X_OK):
+        return []
+
     proc = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
     lines = proc.stdout.splitlines()