Browse Source

add GetCurrentDir function to get a SConscript directory.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1544 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 14 years ago
parent
commit
42d3a22e90
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tools/building.py

+ 7 - 0
tools/building.py

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