rt-thread-official/bsp/nuvoton/libraries/m480/StdDriver/SConscript

29 lines
968 B
Python
Raw Normal View History

# 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')
cpppath = [cwd + '/inc']
2020-06-30 12:17:18 +08:00
libpath = [cwd + '/lib']
2020-06-30 12:17:18 +08:00
if not GetDepend('BSP_USE_STDDRIVER_SOURCE'):
if rtconfig.CROSS_TOOL == 'keil':
2020-06-30 12:17:18 +08:00
if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'):
libs += ['libstddriver_keil']
2020-06-30 12:17:18 +08:00
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']
2020-06-30 12:17:18 +08:00
elif os.path.isfile('./lib/libstddriver_iar.a'):
libs += ['libstddriver_iar']
if not libs:
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath)
else:
src = []
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
Return('group')