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_HSUSBD') and ( GetDepend('BSP_USING_USBD') or GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_HSOTG') ):
13    print ('Sorry, wrong selection.')
14    print ('[Hint] You already select BOARD_USING_HSUSBD. Please de-select BSP_USING_USBD, BSP_USING_HSUSBH and BSP_USING_HSOTG options.')
15    sys.exit(1)
16elif GetDepend('BOARD_USING_HSUSBD_USBH') and ( GetDepend('BSP_USING_USBD') or GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_HSOTG') ):
17    print ('Sorry, wrong selection.')
18    print ('[Hint] You already select BOARD_USING_HSUSBD_USBH. Please de-select BSP_USING_USBD, BSP_USING_HSUSBH and BSP_USING_HSOTG options.')
19    sys.exit(1)
20elif GetDepend('BOARD_USING_HSUSBH') and ( GetDepend('BSP_USING_USBH') or GetDepend('BSP_USING_HSUSBD') or GetDepend('BSP_USING_HSOTG') ):
21    print ('Sorry, wrong selection.')
22    print ('[Hint] You already select BOARD_USING_HSUSBH. Please de-select BSP_USING_USBH, BSP_USING_HSUSBD and BSP_USING_HSOTG options.')
23    sys.exit(1)
24elif GetDepend('BOARD_USING_HSUSBH_USBD') and ( GetDepend('BSP_USING_USBH') or GetDepend('BSP_USING_HSUSBD') or GetDepend('BSP_USING_HSOTG') ):
25    print ('Sorry, wrong selection.')
26    print ('[Hint] You already select BOARD_USING_HSUSBH_USBD. Please de-select BSP_USING_USBH, BSP_USING_HSUSBD and BSP_USING_HSOTG options.')
27    sys.exit(1)
28elif GetDepend('BOARD_USING_HSOTG') and ( GetDepend('BSP_USING_USBD') or GetDepend('BSP_USING_USBH') ):
29    print ('Sorry, wrong selection.')
30    print ('[Hint] You already select BOARD_USING_HSOTG. Please de-select BSP_USING_USBD and BSP_USING_USBH options.')
31    sys.exit(1)
32else:
33    group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
34
35Return('group')
36