Browse Source

[sconscript] application文件夹增加工程文件路径向下扫描功能

用户在加入自己的工程文件夹时,只要该文件内含有Sconscript,就可以被自动探测到,无需手动修改application下的sconscript手动添加。
Meco Jianting Man 4 years ago
parent
commit
71a5385a97
1 changed files with 7 additions and 0 deletions
  1. 7 0
      bsp/stm32/stm32f407-atk-explorer/applications/SConscript

+ 7 - 0
bsp/stm32/stm32f407-atk-explorer/applications/SConscript

@@ -1,4 +1,5 @@
 import rtconfig
 import rtconfig
+import os
 from building import *
 from building import *
 
 
 cwd     = GetCurrentDir()
 cwd     = GetCurrentDir()
@@ -9,4 +10,10 @@ main.c
 
 
 group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
 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')
 Return('group')