summaryrefslogtreecommitdiff
path: root/bsp/nuvoton/libraries/m031/StdDriver/SConscript
blob: b8c471cad1a1c6ceab1adb37227994d77cec047e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# 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'):
    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']

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')