SConscript 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import os
  2. from building import *
  3. Import('rtconfig')
  4. group = []
  5. if rtconfig.PLATFORM == 'gcc':
  6. from gcc import *
  7. elif rtconfig.PLATFORM == 'llvm-arm':
  8. from llvm_arm import *
  9. else:
  10. Return('group')
  11. picolibc_version = GetPicoLibcVersion(rtconfig)
  12. if picolibc_version and not GetDepend('RT_USING_EXTERNAL_LIBC'):
  13. print('PicoLibc version: ' + picolibc_version)
  14. cwd = GetCurrentDir()
  15. src = Glob('*.c')
  16. CPPPATH = [cwd]
  17. CPPDEFINES = ['RT_USING_PICOLIBC', 'RT_USING_LIBC', '_POSIX_C_SOURCE=1', '__PICOLIBC_ERRNO_FUNCTION=pico_get_errno'] # identify this is Newlib, and only enable POSIX.1-1990
  18. # LIBS = ['c', 'm'] # link libc and libm
  19. AddDepend(['RT_USING_PICOLIBC', 'RT_USING_LIBC'])
  20. group = group + DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)#, LIBS = LIBS)
  21. list = os.listdir(cwd)
  22. for d in list:
  23. path = os.path.join(cwd, d)
  24. if os.path.isfile(os.path.join(path, 'SConscript')):
  25. group = group + SConscript(os.path.join(d, 'SConscript'))
  26. Return('group')