From fa4b7ec8fdb45e533e17283d4537d50ee4e7dbb2 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Fri, 15 Oct 2021 15:14:30 -0400 Subject: [PATCH] [stm32][bsp] The sconscript script in the application folder increases the recursion searching capability --- bsp/stm32/stm32f103-blue-pill/applications/SConscript | 11 ++++++++--- .../stm32f407-atk-explorer/applications/SConscript | 9 +++------ .../stm32l475-atk-pandora/applications/SConscript | 11 +++++++++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/bsp/stm32/stm32f103-blue-pill/applications/SConscript b/bsp/stm32/stm32f103-blue-pill/applications/SConscript index ef1c39fd83..d6acfac79f 100644 --- a/bsp/stm32/stm32f103-blue-pill/applications/SConscript +++ b/bsp/stm32/stm32f103-blue-pill/applications/SConscript @@ -1,11 +1,16 @@ -Import('RTT_ROOT') -Import('rtconfig') from building import * +import os cwd = GetCurrentDir() src = Glob('*.c') -CPPPATH = [cwd, ] +CPPPATH = [cwd] group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) +list = os.listdir(cwd) +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + group = group + SConscript(os.path.join(d, 'SConscript')) + Return('group') diff --git a/bsp/stm32/stm32f407-atk-explorer/applications/SConscript b/bsp/stm32/stm32f407-atk-explorer/applications/SConscript index d229539fc7..64381a1679 100644 --- a/bsp/stm32/stm32f407-atk-explorer/applications/SConscript +++ b/bsp/stm32/stm32f407-atk-explorer/applications/SConscript @@ -1,12 +1,9 @@ -import rtconfig -import os from building import * +import os cwd = GetCurrentDir() -CPPPATH = [cwd, str(Dir('#'))] -src = Split(""" -main.c -""") +CPPPATH = [cwd] +src = Glob('*.c') group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/SConscript b/bsp/stm32/stm32l475-atk-pandora/applications/SConscript index f45bd21bc2..77d927a66b 100644 --- a/bsp/stm32/stm32l475-atk-pandora/applications/SConscript +++ b/bsp/stm32/stm32l475-atk-pandora/applications/SConscript @@ -1,6 +1,7 @@ from building import * +import os -cwd = GetCurrentDir() +cwd = GetCurrentDir() src = Split(''' main.c @@ -12,8 +13,14 @@ if GetDepend(['BSP_USING_SPI_LCD']): if GetDepend(['PKG_USING_NRF24L01']): src += ['nrf24l01_init.c'] -CPPPATH = [str(Dir('#')), cwd] +CPPPATH = [cwd] group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) +list = os.listdir(cwd) +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + group = group + SConscript(os.path.join(d, 'SConscript')) + Return('group')