blob: 97b40ad6c59c7a146258d8ef363ca71ae1c349f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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') 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')
|