SConscript 971 B

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