From 7e260dbcce375152eaa52d3be5f1f8465943bd5d Mon Sep 17 00:00:00 2001 From: "www220@tom.com" Date: Wed, 8 Apr 2015 00:52:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3rtt-root=E4=BD=8D=E4=BA=8E?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E7=9B=AE=E5=BD=95=E6=97=B6=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E9=94=99=E8=AF=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/vs2012.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/vs2012.py b/tools/vs2012.py index 6badef8ad..63457e0a0 100644 --- a/tools/vs2012.py +++ b/tools/vs2012.py @@ -90,6 +90,9 @@ def VS2012_CreateFilter(script, project_path): # files: c/h list # project_path def VS_add_ItemGroup(parent, file_type, files, project_path): + from building import Rtt_Root + RTT_ROOT = os.path.normpath(Rtt_Root) + file_dict = {'C':"ClCompile", 'H':'ClInclude'} item_tag = file_dict[file_type] @@ -99,7 +102,18 @@ def VS_add_ItemGroup(parent, file_type, files, project_path): name = fn.name path = os.path.dirname(fn.abspath) - objpath = path = _make_path_relative(project_path, path) + objpath = path.lower() + if len(project_path) >= len(RTT_ROOT) : + if objpath.startswith(project_path.lower()) : + objpath = ''.join('bsp'+objpath[len(project_path):]) + else : + objpath = ''.join('kernel'+objpath[len(RTT_ROOT):]) + else : + if objpath.startswith(RTT_ROOT.lower()) : + objpath = ''.join('kernel'+objpath[len(RTT_ROOT):]) + else : + objpath = ''.join('bsp'+objpath[len(project_path):]) + path = _make_path_relative(project_path, path) path = os.path.join(path, name) File = SubElement(ItemGroup, item_tag)