diff options
| author | bernard <[email protected]> | 2024-04-21 01:50:14 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2024-04-20 14:39:28 -0400 |
| commit | 582d11faadeca147795d2fcf8ffd41bd3cb9a79e (patch) | |
| tree | 61a43634845bc485ec85c2676000d8239151e479 | |
| parent | b76dca8f4f70b006db4ce52d8481839524187ec0 (diff) | |
[tools] fix EXEC_PATH exists, but the CC does not.
| -rw-r--r-- | tools/building.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/building.py b/tools/building.py index 3b85bc9930..f07eb47990 100644 --- a/tools/building.py +++ b/tools/building.py @@ -195,23 +195,23 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ os.environ['RTT_CC_PREFIX'] = exec_prefix # auto change the 'RTT_EXEC_PATH' when 'rtconfig.EXEC_PATH' get failed - if not os.path.exists(rtconfig.EXEC_PATH): + if not os.path.exists(os.path.join(rtconfig.EXEC_PATH, rtconfig.CC)): if 'RTT_EXEC_PATH' in os.environ: # del the 'RTT_EXEC_PATH' and using the 'EXEC_PATH' setting on rtconfig.py del os.environ['RTT_EXEC_PATH'] try: # try to detect toolchains in env - from utils import ImportModule - envm = ImportModule('env') + envm = utils.ImportModule('env') # from env import GetSDKPath exec_path = envm.GetSDKPath(rtconfig.CC) if 'gcc' in rtconfig.CC: exec_path = os.path.join(exec_path, 'bin') - if os.path.exists(exec_path): - print('set CC to ' + exec_path) - rtconfig.EXEC_PATH = exec_path - os.environ['RTT_EXEC_PATH'] = exec_path + + if os.path.exists(exec_path): + print('set CC to ' + exec_path) + rtconfig.EXEC_PATH = exec_path + os.environ['RTT_EXEC_PATH'] = exec_path except Exception as e: # detect failed, ignore pass |
