2021-02-05 18:52:13 +08:00
|
|
|
# RT-Thread building script for component
|
|
|
|
Import('rtconfig')
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
libs = []
|
|
|
|
src = Glob('*src/*.c') + Glob('src/*.cpp')
|
|
|
|
cpppath = [cwd + '/inc']
|
|
|
|
libpath = [cwd + '/lib']
|
|
|
|
|
|
|
|
if not GetDepend('BSP_USE_STDDRIVER_SOURCE'):
|
2022-04-20 09:56:04 +08:00
|
|
|
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2021-02-05 18:52:13 +08:00
|
|
|
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']
|
2022-04-20 09:56:04 +08:00
|
|
|
elif rtconfig.PLATFORM == 'gcc' and os.path.isfile('./lib/libstddriver_gcc.a'):
|
2021-02-05 18:52:13 +08:00
|
|
|
libs += ['libstddriver_gcc']
|
|
|
|
elif os.path.isfile('./lib/libstddriver_iar.a'):
|
|
|
|
libs += ['libstddriver_iar']
|
|
|
|
|
|
|
|
if not libs:
|
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath)
|
|
|
|
else:
|
|
|
|
src = []
|
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
|
|
|
|
|
|
|
|
Return('group')
|