SConscript 752 B

1234567891011121314151617181920212223242526272829
  1. # RT-Thread building script for component
  2. import SCons, os
  3. from building import *
  4. group = []
  5. if not GetDepend(['RT_USING_VBUS']):
  6. Return('group')
  7. cwd = GetCurrentDir()
  8. src = Glob('*.c')
  9. for c, f in [['RT_USING_VBUS_RFS', 'utilities/rfs.c'],
  10. ['RT_USING_VBUS_RSHELL', 'utilities/rshell.c'],
  11. ]:
  12. if GetDepend(c):
  13. src += Glob(f)
  14. with open(os.path.join(Dir('#').get_abspath(), 'vbus_local_conf.h'), 'r') as f:
  15. cpp = SCons.cpp.PreProcessor()
  16. cpp.process_contents(f.read())
  17. if 'RT_VBUS_USING_TESTS' in cpp.cpp_namespace:
  18. src += Glob('tests/*.c')
  19. CPPPATH = [cwd, os.path.join(cwd, 'share_hdr')]
  20. group = DefineGroup('VBus', src, depend = ['RT_USING_VBUS'], CPPPATH = CPPPATH)
  21. Return('group')