summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2023-12-30 19:26:03 +0800
committerRbb666 <[email protected]>2024-01-09 14:29:55 +0800
commit58a159a0d6a986aa5b58a0704be3ab58f8686040 (patch)
tree659b5b7a2ab88d2f830b774de759a804ee2db3c9
parentdb5bdb1ffadced28e40b97cd62e95f87ee248db9 (diff)
[finsh] support to check static thread size
增加检查finsh线程实际使用是否超过当前设定的线程大小
-rw-r--r--components/finsh/SConscript12
1 files changed, 9 insertions, 3 deletions
diff --git a/components/finsh/SConscript b/components/finsh/SConscript
index 70f8e5608c..98c7da3151 100644
--- a/components/finsh/SConscript
+++ b/components/finsh/SConscript
@@ -1,4 +1,5 @@
from building import *
+from gcc import GetGCCLikePLATFORM
cwd = GetCurrentDir()
src = Split('''
@@ -7,14 +8,19 @@ msh.c
msh_parse.c
''')
+CPPPATH = [cwd]
+LOCAL_CFLAGS = ''
+
+if rtconfig.PLATFORM in GetGCCLikePLATFORM():
+ LOCAL_CFLAGS += ' -Wstack-usage=' + str(GetConfigValue('FINSH_THREAD_STACK_SIZE')) # check finsh thread stack size
+
if GetDepend('MSH_USING_BUILT_IN_COMMANDS'):
src += ['cmd.c']
if GetDepend('DFS_USING_POSIX'):
src += ['msh_file.c']
-CPPPATH = [cwd]
-
-group = DefineGroup('Finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH)
+group = DefineGroup('Finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH,
+ LOCAL_CFLAGS = LOCAL_CFLAGS)
Return('group')