-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSConstruct
31 lines (27 loc) · 1018 Bytes
/
SConstruct
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
from pathlib import Path
import os
import shutil
os.environ['SDK_PATH'] = os.path.normpath(str(Path(os.getcwd())/'..'/'..'/'SDK'))
os.environ['EXT_COMPONENTS_PATH'] = os.path.normpath(str(Path(os.getcwd())/'..'/'..'/'ext_components'))
version = 'v0.0.7'
static_lib = 'static_lib'
update = False
with open(str(Path(os.getcwd())/'..'/'..'/'SDK'/'tools'/'scons'/'project.py')) as f:
exec(f.read())
if not os.path.exists(static_lib):
update = True
else:
try:
with open(str(Path(static_lib)/'version'), 'r') as f:
if f.read() != version:
update = True
except:
update = True
if update:
with open(env['PROJECT_TOOL_S']) as f:
exec(f.read())
down_url = "https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/linux/llm/static_lib_{}.tar.gz".format(version)
down_path = check_wget_down(down_url, "static_lib_{}.tar.gz".format(version))
if os.path.exists(static_lib):
shutil.rmtree(static_lib)
shutil.move(down_path, static_lib)