2020-06-17 16:30:11 +08:00
|
|
|
# RT-Thread building script for component
|
|
|
|
Import('rtconfig')
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
2020-06-30 12:17:18 +08:00
|
|
|
libs = []
|
|
|
|
src = Glob('*src/*.c') + Glob('src/*.cpp')
|
2020-06-17 16:30:11 +08:00
|
|
|
cpppath = [cwd + '/inc']
|
2020-06-30 12:17:18 +08:00
|
|
|
libpath = [cwd + '/lib']
|
2020-06-17 16:30:11 +08:00
|
|
|
|
2020-06-30 12:17:18 +08:00
|
|
|
if not GetDepend('BSP_USE_STDDRIVER_SOURCE'):
|
2023-01-09 10:14:23 +08:00
|
|
|
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
|
|
|
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.PLATFORM in ['gcc'] and os.path.isfile('./lib/libstddriver_gcc.a'):
|
|
|
|
libs += ['libstddriver_gcc']
|
|
|
|
elif os.path.isfile('./lib/libstddriver_iar.a'):
|
|
|
|
libs += ['libstddriver_iar']
|
2020-06-30 12:17:18 +08:00
|
|
|
|
|
|
|
if not libs:
|
2023-01-09 10:14:23 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath)
|
2020-06-30 12:17:18 +08:00
|
|
|
else:
|
2023-01-09 10:14:23 +08:00
|
|
|
src = []
|
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
|
2020-06-17 16:30:11 +08:00
|
|
|
|
|
|
|
Return('group')
|