1
0

SConscript 954 B

1234567891011121314151617181920212223242526272829
  1. import os
  2. from building import *
  3. from llvm_arm import *
  4. Import('rtconfig')
  5. group = []
  6. picolibc_version = GetPicoLibcVersion(rtconfig)
  7. if picolibc_version and not GetDepend('RT_USING_EXTERNAL_LIBC'):
  8. print('PicoLibc version: ' + picolibc_version)
  9. cwd = GetCurrentDir()
  10. src = Glob('*.c')
  11. CPPPATH = [cwd]
  12. 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
  13. # LIBS = ['c', 'm'] # link libc and libm
  14. AddDepend(['RT_USING_PICOLIBC', 'RT_USING_LIBC'])
  15. group = group + DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)#, LIBS = LIBS)
  16. list = os.listdir(cwd)
  17. for d in list:
  18. path = os.path.join(cwd, d)
  19. if os.path.isfile(os.path.join(path, 'SConscript')):
  20. group = group + SConscript(os.path.join(d, 'SConscript'))
  21. Return('group')