SConscript 884 B

1234567891011121314151617181920212223242526
  1. Import('rtconfig')
  2. from building import *
  3. import os
  4. import shutil
  5. src = ['perf_counter.c', 'os/perf_os_patch_rt_thread.c']
  6. cwd = GetCurrentDir()
  7. path = [cwd]
  8. CPPDEFINES = ['__PERF_COUNT_PLATFORM_SPECIFIC_HEADER__=<rtthread.h>', '__perf_counter_printf__=rt_kprintf', '__PERF_CNT_USE_RTOS__']
  9. #delate unused files
  10. try:
  11. shutil.rmtree(os.path.join(cwd,'.github'))
  12. shutil.rmtree(os.path.join(cwd,'.vscode'))
  13. shutil.rmtree(os.path.join(cwd,'CI'))
  14. shutil.rmtree(os.path.join(cwd,'cmsis-pack'))
  15. shutil.rmtree(os.path.join(cwd,'lib'))
  16. shutil.rmtree(os.path.join(cwd,'example'))
  17. os.remove(os.path.join(cwd,'systick_wrapper_gcc.s'))
  18. os.remove(os.path.join(cwd,'systick_wrapper_ual.s'))
  19. except:
  20. pass
  21. group = DefineGroup('perf_counter', src, depend = ['PKG_USING_PERF_COUNTER'], CPPDEFINES = CPPDEFINES, CPPPATH = path, CXXFLAGS = ' --gnu')
  22. Return('group')