[tools/gcc.py]fix scons error.

This commit is contained in:
guozhanxin 2023-11-14 18:18:07 +08:00 committed by Meco Man
parent 7a56058c61
commit 0b1a49ed66
1 changed files with 4 additions and 0 deletions

View File

@ -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()