Files
rt-thread/components/rust/SConscript
T
yan hu 30af7388a4 [rust][tools] Fix Rust build example configuration handling
Improve the Rust build integration across core, applications, components, and module examples. Fix build failure propagation, target and feature handling, linker flags, example configuration semantics, and add STM32 CI attach coverage.
2026-08-21 11:17:57 +08:00

29 lines
634 B
Python

# for module compiling
import os
from building import *
objs = []
def _has(sym: str) -> bool:
try:
return bool(GetDepend([sym]))
except Exception:
return bool(GetDepend(sym))
if not _has('RT_USING_RUST') and not GetOption('clean'):
Return('objs')
cwd = GetCurrentDir()
entries = os.listdir(cwd)
for d in entries:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
result = SConscript(os.path.join(d, 'SConscript'))
if isinstance(result, (list, tuple)):
objs.extend(result)
else:
objs.append(result)
Return('objs')