add GetCurrentDir function to get a SConscript directory.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1544 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2011-06-29 05:15:31 +00:00
parent 294e34e1e6
commit 42d3a22e90
1 changed files with 7 additions and 0 deletions

View File

@ -548,6 +548,13 @@ def DefineGroup(name, src, depend, **parameters):
return objs return objs
def GetCurrentDir():
conscript = File('SConscript')
fn = conscript.rfile()
name = fn.name
path = os.path.dirname(fn.abspath)
return path
def EndBuilding(target): def EndBuilding(target):
import rtconfig import rtconfig
Env.AddPostAction(target, rtconfig.POST_ACTION) Env.AddPostAction(target, rtconfig.POST_ACTION)