Skip to content

Commit 2b82674

Browse files
committed
Shrink package size.
1 parent f982529 commit 2b82674

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

bsp/nuvoton/libraries/m480/StdDriver/SConscript

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@ Import('rtconfig')
33
from building import *
44

55
cwd = GetCurrentDir()
6-
src = []
7-
libs = ['']
8-
libpath = [cwd + '/lib']
6+
libs = []
7+
src = Glob('*src/*.c') + Glob('src/*.cpp')
98
cpppath = [cwd + '/inc']
9+
libpath = [cwd + '/lib']
1010

11-
if GetDepend('BSP_USE_STDDRIVER_SOURCE'):
12-
src = Glob('*src/*.c') + Glob('src/*.cpp')
13-
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath)
14-
else:
11+
if not GetDepend('BSP_USE_STDDRIVER_SOURCE'):
1512
if rtconfig.CROSS_TOOL == 'keil':
16-
if GetOption('target') == 'mdk4':
17-
libs += ['libstddriver_keil4']
18-
if GetOption('target') == 'mdk5':
13+
if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'):
1914
libs += ['libstddriver_keil']
20-
elif rtconfig.CROSS_TOOL == 'gcc':
15+
elif GetOption('target') == 'mdk4' and os.path.isfile('./lib/libstddriver_keil4.lib'):
16+
libs += ['libstddriver_keil4']
17+
elif rtconfig.CROSS_TOOL == 'gcc' and os.path.isfile('./lib/libstddriver_gcc.a'):
2118
libs += ['libstddriver_gcc']
22-
else:
23-
libs += ['libstddriver_iar']
19+
elif os.path.isfile('./lib/libstddriver_iar.a'):
20+
libs += ['libstddriver_iar']
21+
22+
if not libs:
23+
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath)
24+
else:
25+
src = []
2426
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
2527

2628
Return('group')
-202 KB
Binary file not shown.
-409 KB
Binary file not shown.
-30.2 MB
Binary file not shown.
-29.3 MB
Binary file not shown.

0 commit comments

Comments
 (0)