优化scons构建

This commit is contained in:
HEYAHONG 2024-11-16 20:37:04 +08:00
parent 629a8ee04a
commit 5b0fe2e608
No known key found for this signature in database
GPG Key ID: 97E3E469FE2C920B

View File

@ -5,11 +5,18 @@ from building import *
# get current directory
cwd = GetCurrentDir()
#RC_FS的编号同一次构建中多个程序需要hrc组件时保证资源文件不重复,通常用于test目录中的程序
HRC_RC_FS_PATH_NUM="1"
if 'HRC_RC_FS_PATH_NUM' in os.environ:
HRC_RC_FS_PATH_NUM=os.environ['HRC_RC_FS_PATH_NUM']
os.environ['HRC_RC_FS_PATH_NUM']=str(int(HRC_RC_FS_PATH_NUM)+1)
#默认文件路径
if not os.path.isdir(os.getcwd()+"/build/"):
os.mkdir(os.getcwd()+"/build/")
HRC_RC_FS_PATH=os.getcwd()+"/build/RC_fs.c"
HRC_RC_FS_PATH=os.getcwd()+"/build/RC_fs_"+HRC_RC_FS_PATH_NUM+".c"
oldcwd=os.getcwd();