diff options
| author | zhang san <[email protected]> | 2025-12-08 18:34:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-08 18:34:25 +0800 |
| commit | 69980f8b9d29b38dbd4ddf6373b4b45f3a138409 (patch) | |
| tree | 21dd9a8ce80e3d30192e9ffa56ea39a199bae309 /components/rust/SConscript | |
| parent | cd1d47b87c5d47e131730e5506eb3ad77d357653 (diff) | |
Adding Rust Language Support for RT-Thread #10910
Diffstat (limited to 'components/rust/SConscript')
| -rw-r--r-- | components/rust/SConscript | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/components/rust/SConscript b/components/rust/SConscript new file mode 100644 index 0000000000..ab84bd7a14 --- /dev/null +++ b/components/rust/SConscript @@ -0,0 +1,28 @@ +# 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'): + 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') |
