Skip to content

Commit 582d11f

Browse files
BernardXiongmysterywolf
authored andcommitted
[tools] fix EXEC_PATH exists, but the CC does not.
1 parent b76dca8 commit 582d11f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/building.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -195,23 +195,23 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
195195
os.environ['RTT_CC_PREFIX'] = exec_prefix
196196

197197
# auto change the 'RTT_EXEC_PATH' when 'rtconfig.EXEC_PATH' get failed
198-
if not os.path.exists(rtconfig.EXEC_PATH):
198+
if not os.path.exists(os.path.join(rtconfig.EXEC_PATH, rtconfig.CC)):
199199
if 'RTT_EXEC_PATH' in os.environ:
200200
# del the 'RTT_EXEC_PATH' and using the 'EXEC_PATH' setting on rtconfig.py
201201
del os.environ['RTT_EXEC_PATH']
202202

203203
try:
204204
# try to detect toolchains in env
205-
from utils import ImportModule
206-
envm = ImportModule('env')
205+
envm = utils.ImportModule('env')
207206
# from env import GetSDKPath
208207
exec_path = envm.GetSDKPath(rtconfig.CC)
209208
if 'gcc' in rtconfig.CC:
210209
exec_path = os.path.join(exec_path, 'bin')
211-
if os.path.exists(exec_path):
212-
print('set CC to ' + exec_path)
213-
rtconfig.EXEC_PATH = exec_path
214-
os.environ['RTT_EXEC_PATH'] = exec_path
210+
211+
if os.path.exists(exec_path):
212+
print('set CC to ' + exec_path)
213+
rtconfig.EXEC_PATH = exec_path
214+
os.environ['RTT_EXEC_PATH'] = exec_path
215215
except Exception as e:
216216
# detect failed, ignore
217217
pass

0 commit comments

Comments
 (0)