Shrink package size.
This commit is contained in:
parent
f9825299b9
commit
2b82674ad1
|
@ -3,24 +3,26 @@ Import('rtconfig')
|
||||||
from building import *
|
from building import *
|
||||||
|
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
src = []
|
libs = []
|
||||||
libs = ['']
|
src = Glob('*src/*.c') + Glob('src/*.cpp')
|
||||||
libpath = [cwd + '/lib']
|
|
||||||
cpppath = [cwd + '/inc']
|
cpppath = [cwd + '/inc']
|
||||||
|
libpath = [cwd + '/lib']
|
||||||
|
|
||||||
if GetDepend('BSP_USE_STDDRIVER_SOURCE'):
|
if not GetDepend('BSP_USE_STDDRIVER_SOURCE'):
|
||||||
src = Glob('*src/*.c') + Glob('src/*.cpp')
|
if rtconfig.CROSS_TOOL == 'keil':
|
||||||
|
if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'):
|
||||||
|
libs += ['libstddriver_keil']
|
||||||
|
elif GetOption('target') == 'mdk4' and os.path.isfile('./lib/libstddriver_keil4.lib'):
|
||||||
|
libs += ['libstddriver_keil4']
|
||||||
|
elif rtconfig.CROSS_TOOL == 'gcc' and os.path.isfile('./lib/libstddriver_gcc.a'):
|
||||||
|
libs += ['libstddriver_gcc']
|
||||||
|
elif os.path.isfile('./lib/libstddriver_iar.a'):
|
||||||
|
libs += ['libstddriver_iar']
|
||||||
|
|
||||||
|
if not libs:
|
||||||
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath)
|
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath)
|
||||||
else:
|
else:
|
||||||
if rtconfig.CROSS_TOOL == 'keil':
|
src = []
|
||||||
if GetOption('target') == 'mdk4':
|
|
||||||
libs += ['libstddriver_keil4']
|
|
||||||
if GetOption('target') == 'mdk5':
|
|
||||||
libs += ['libstddriver_keil']
|
|
||||||
elif rtconfig.CROSS_TOOL == 'gcc':
|
|
||||||
libs += ['libstddriver_gcc']
|
|
||||||
else:
|
|
||||||
libs += ['libstddriver_iar']
|
|
||||||
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
|
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue