-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSConscript
40 lines (31 loc) · 975 Bytes
/
SConscript
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
29
30
31
32
33
34
35
36
37
38
39
40
Import('rtconfig')
from building import *
cwd = GetCurrentDir()
sys.path.append(cwd)
from rust_build import PrebuildRust
from rust_build import SeleceFeature
from rust_build import PrepareSetFeature
from rust_build import ClearFeature
src = []
LINKFLAGS = ""
if GetOption('clean'):
ClearFeature(cwd)
import shutil
import os
shutil.rmtree(os.path.join(cwd, 'rust_out'))
group = DefineGroup('rust', src, depend=[])
else:
PrepareSetFeature(cwd)
if GetDepend("RT_USING_SMP"):
SeleceFeature("smp")
ret = PrebuildRust(cwd, rtconfig.CPU, Rtt_Root, Rtt_Root+"/../applications/")
if ret == "OK":
LINKFLAGS = " -L%s" % (cwd + "/rust_out/")
LINKFLAGS += " -Wl,--whole-archive -lrust -Wl,--no-whole-archive"
LINKFLAGS += " -Wl,--allow-multiple-definition"
elif ret == "PASS":
pass
elif ret == "ERR":
raise Exception("RUST BUILD FATAL ERROR!!!")
group = DefineGroup('rust', src, depend=[], LINKFLAGS=LINKFLAGS)
Return('group')