SConscript 698 B

12345678910111213141516171819202122
  1. from building import *
  2. import os
  3. Import('rtconfig')
  4. cwd = GetCurrentDir()
  5. src = ['cxx_crt_init.c', 'cxx_crt.cpp']
  6. CPPPATH = [cwd]
  7. CXXFLAGS = ''
  8. if rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm'] and not GetDepend('RT_USING_CPP_EXCEPTIONS'):
  9. CXXFLAGS += ' -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections' # reduce resource consumptions
  10. group = DefineGroup('CPP', src, depend=['RT_USING_CPLUSPLUS'], CPPPATH=CPPPATH, CXXFLAGS=CXXFLAGS)
  11. list = os.listdir(cwd)
  12. for d in list:
  13. path = os.path.join(cwd, d)
  14. if os.path.isfile(os.path.join(path, 'SConscript')):
  15. group = group + SConscript(os.path.join(d, 'SConscript'))
  16. Return('group')