SConscript 909 B

1234567891011121314151617181920212223242526
  1. # RT-Thread building script for component
  2. Import('rtconfig')
  3. from building import *
  4. cwd = GetCurrentDir()
  5. libs = []
  6. src = Glob('Source/*.c') + Glob('Source/*.cpp')
  7. cpppath = [cwd + '/Include']
  8. libpath = [cwd + '/Library']
  9. if not GetDepend('BSP_USE_STDDRIVER_SOURCE'):
  10. if rtconfig.PLATFORM in ['armcc', 'armclang']:
  11. if GetOption('target') == 'mdk4' and os.path.isfile('./Library/libstddriver_keil4.lib'):
  12. libs += ['libstddriver_keil4']
  13. if GetOption('target') == 'mdk5' and os.path.isfile('./Library/libstddriver_keil.lib'):
  14. libs += ['libstddriver_keil']
  15. elif rtconfig.PLATFORM in ['gcc'] and os.path.isfile('./Library/libstddriver_gcc.a'):
  16. libs += ['libstddriver_gcc']
  17. if not libs:
  18. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath)
  19. else:
  20. src = []
  21. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
  22. Return('group')