1# RT-Thread building script for component
2
3Import('RTT_ROOT')
4from building import *
5
6cwd     = GetCurrentDir()
7src = Glob('*.c') + Glob('*.cpp')
8CPPPATH = [cwd]
9group = []
10
11# USB driver constrain
12if GetDepend('BOARD_USING_USBD') and ( GetDepend('BSP_USING_OTG') or GetDepend('BSP_USING_USBH') ):
13    print ('Sorry, wrong selection.')
14    print ('[Hint] You already select BOARD_USING_USBD. Please de-select BSP_USING_OTG and BSP_USING_USBH.')
15    sys.exit(1)
16elif GetDepend('BOARD_USING_USBH') and ( GetDepend('BSP_USING_OTG') or GetDepend('BSP_USING_USBD') ):
17    print ('Sorry, wrong selection.')
18    print ('[Hint] You already select BOARD_USING_USBH. Please de-select BSP_USING_OTG and BSP_USING_USBD options.')
19    sys.exit(1)
20else:
21    group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
22
23Return('group')
24