2020-12-21 14:34:01 +08:00
|
|
|
# RT-Thread building script for component
|
|
|
|
Import('rtconfig')
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
libs = []
|
|
|
|
src = Glob('Source/*.c') + Glob('Source/*.cpp')
|
|
|
|
cpppath = [cwd + '/Include']
|
|
|
|
libpath = [cwd + '/Library']
|
|
|
|
|
|
|
|
if not GetDepend('BSP_USE_STDDRIVER_SOURCE'):
|
2022-04-20 09:56:04 +08:00
|
|
|
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2020-12-21 14:34:01 +08:00
|
|
|
if GetOption('target') == 'mdk4' and os.path.isfile('./Library/libstddriver_keil4.lib'):
|
|
|
|
libs += ['libstddriver_keil4']
|
|
|
|
if GetOption('target') == 'mdk5' and os.path.isfile('./Library/libstddriver_keil.lib'):
|
|
|
|
libs += ['libstddriver_keil']
|
2022-05-31 06:04:05 +08:00
|
|
|
elif rtconfig.PLATFORM in ['gcc'] and os.path.isfile('./Library/libstddriver_gcc.a'):
|
2020-12-21 14:34:01 +08:00
|
|
|
libs += ['libstddriver_gcc']
|
|
|
|
|
|
|
|
if not libs:
|
2021-02-01 10:35:44 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath)
|
2020-12-21 14:34:01 +08:00
|
|
|
else:
|
|
|
|
src = []
|
2021-02-01 10:35:44 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
|
2020-12-21 14:34:01 +08:00
|
|
|
|
|
|
|
Return('group')
|