SConscript 942 B

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