Skip to content

Commit 7eb0dce

Browse files
authored
Merge pull request #172 from Felix-LJY/master
添加EXEC_PATH自动查找
2 parents e473f63 + 4eb0593 commit 7eb0dce

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

target/sieon/s1/rtconfig.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import os
2+
import shutil
3+
4+
from pathlib import Path
25

36
# board options
47
BOARD = 'sieon-s1'
@@ -17,7 +20,17 @@
1720
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
1821
if CROSS_TOOL == 'gcc':
1922
PLATFORM = 'gcc'
20-
EXEC_PATH = 'your-compiler-path'
23+
if os.getenv('RTT_EXEC_PATH'):
24+
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
25+
else:
26+
try:
27+
EXEC_PATH = str(Path(shutil.which('arm-none-eabi-gcc')).parent)
28+
except:
29+
print('================ERROR============================')
30+
print('Not found arm-none-eabi-gcc in PATH!')
31+
print('Please set it manually in your PATH!')
32+
print('=================================================')
33+
exit(0)
2134
else:
2235
print('================ERROR============================')
2336
print('Not support %s yet!' % CROSS_TOOL)

0 commit comments

Comments
 (0)