SConscript 1.0 KB
Newer Older
L
luo jiao 已提交
1 2 3 4 5 6 7 8 9 10 11 12
import rtconfig
from building import *

# get current directory
cwd = GetCurrentDir()

# The set of source files associated with this SConscript file.

src = Glob('GD32F30x_standard_peripheral/Source/*.c')
src += [cwd + '/CMSIS/GD/GD32F30x/Source/system_gd32f30x.c']

#add for startup script
13
if rtconfig.PLATFORM in ['gcc']:
14
    src += [cwd + '/CMSIS/GD/GD32F30x/Source/GCC/startup_gd32f30x_hd.S']
15
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
L
luo jiao 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
    src += [cwd + '/CMSIS/GD/GD32F30x/Source/ARM/startup_gd32f30x_hd.s']
elif rtconfig.CROSS_TOOL == 'iar':
    src += [cwd + '/CMSIS/GD/GD32F30x/Source/IAR/startup_gd32f30x_hd.s']

path = [
    cwd + '/CMSIS/GD/GD32F30x/Include',
    cwd + '/CMSIS',
    cwd + '/GD32F30x_standard_peripheral/Include',]
    
if GetDepend(['RT_USING_BSP_USB']):
    path += [cwd + '/GD32F30x_usb_driver/Include']
    src  += [cwd + '/GD32F30x_usb_driver/Source']

CPPDEFINES = ['USE_STDPERIPH_DRIVER', 'GD32F30X_HD']

Nameless-Y's avatar
Nameless-Y 已提交
31
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
L
luo jiao 已提交
32 33

Return('group')