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 năm trước cách đây
mục cha
commit
42d3a22e90
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      tools/building.py

+ 7 - 0
tools/building.py

@@ -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)