From 33769db3cf9c49172c402a4950ec5a8f33fe9948 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 15 Feb 2021 07:17:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[libc][gcc][keil]=20=E5=9C=A8sconscript?= =?UTF-8?q?=E4=B8=AD=E5=AE=9A=E4=B9=89RT=5FTICK=5FPER=5FSECOND=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/SConscript | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 2407301405..1cf84df01c 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -16,7 +16,14 @@ else: if GetDepend('RT_USING_POSIX') == False: SrcRemove(src, ['unistd.c']) +if rtconfig.CROSS_TOOL == 'keil': + CPPDEFINES = ['__CLK_TCK=RT_TICK_PER_SECOND'] +elif rtconfig.CROSS_TOOL == 'gcc': + CPPDEFINES = ['_CLOCKS_PER_SEC_=RT_TICK_PER_SECOND'] +else: + CPPDEFINES = [] + if not GetDepend('RT_USING_MINILIBC') and (GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME')): - group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) + group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) Return('group') From 4615a7d96c633e63d93ae2ed97a035defdea2736 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 15 Feb 2021 07:35:14 +0800 Subject: [PATCH 2/2] remove gcc --- components/libc/compilers/common/SConscript | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 1cf84df01c..8877f07f24 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -18,8 +18,6 @@ if GetDepend('RT_USING_POSIX') == False: if rtconfig.CROSS_TOOL == 'keil': CPPDEFINES = ['__CLK_TCK=RT_TICK_PER_SECOND'] -elif rtconfig.CROSS_TOOL == 'gcc': - CPPDEFINES = ['_CLOCKS_PER_SEC_=RT_TICK_PER_SECOND'] else: CPPDEFINES = []