-
Notifications
You must be signed in to change notification settings - Fork 83
/
SConscript
35 lines (28 loc) · 1.08 KB
/
SConscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Import('rtconfig')
from building import *
import os
import shutil
src = ['perf_counter.c', 'os/perf_os_patch_rt_thread.c']
cwd = GetCurrentDir()
path = [cwd]
CPPDEFINES = ['__PERF_COUNT_PLATFORM_SPECIFIC_HEADER__=<rtthread.h>', '__perf_counter_printf__=rt_kprintf']
if GetDepend('PKG_PERF_COUNTER_USING_THREAD_STATISTIC'):
CPPDEFINES += ['__PERF_CNT_USE_RTOS__']
#delate unused files
try:
shutil.rmtree(os.path.join(cwd,'.github'))
shutil.rmtree(os.path.join(cwd,'.vscode'))
shutil.rmtree(os.path.join(cwd,'CI'))
shutil.rmtree(os.path.join(cwd,'cmsis-pack'))
shutil.rmtree(os.path.join(cwd,'lib'))
shutil.rmtree(os.path.join(cwd,'example'))
os.remove(os.path.join(cwd,'systick_wrapper_gcc.s'))
os.remove(os.path.join(cwd,'systick_wrapper_gnu.s'))
os.remove(os.path.join(cwd,'systick_wrapper_ual.s'))
except:
pass
CXXFLAGS = ''
if rtconfig.PLATFORM == 'armcc': # Keil AC5
CXXFLAGS += ' --gnu'
group = DefineGroup('perf_counter', src, depend = ['PKG_USING_PERF_COUNTER'], CPPDEFINES = CPPDEFINES, CPPPATH = path, CXXFLAGS = CXXFLAGS)
Return('group')