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

用户在加入自己的工程文件夹时,只要该文件内含有Sconscript,就可以被自动探测到,无需手动修改application下的sconscript手动添加。
This commit is contained in:
Meco Jianting Man 2021-05-14 10:06:27 +08:00 committed by GitHub
parent 74064e8cc7
commit 71a5385a97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import rtconfig
import os
from building import *
cwd = GetCurrentDir()
@ -9,4 +10,10 @@ main.c
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')