From 42d3a22e908bcf5d6895555042122345b8970f30 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Wed, 29 Jun 2011 05:15:31 +0000 Subject: [PATCH] add GetCurrentDir function to get a SConscript directory. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1544 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- tools/building.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/building.py b/tools/building.py index 0e7718d65..88cdf7dc3 100644 --- a/tools/building.py +++ b/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)