summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2015-04-10 06:34:02 +0000
committerBernard Xiong <[email protected]>2015-04-10 06:34:02 +0000
commit4b838caaf808f72a0d449926d9f7d43d4fa05815 (patch)
treec901b34eb0ffc61691a80a75ca1725f4dd8909d0 /tools
parent655054b1c52c103afb5c815eea408e112da26c7d (diff)
parent2ff048f7f0170d618333edc4484cb6b09eaf17fd (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'tools')
-rw-r--r--tools/vs2012.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/vs2012.py b/tools/vs2012.py
index 14da3dcace..63457e0a0a 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,11 +102,25 @@ def VS_add_ItemGroup(parent, file_type, files, project_path):
name = fn.name
path = os.path.dirname(fn.abspath)
+ 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)
File.set('Include', path.decode(fs_encoding))
+ if file_type == 'C' :
+ ObjName = SubElement(File, 'ObjectFileName')
+ ObjName.text = ''.join('$(IntDir)'+objpath+'\\')
def VS_add_HeadFiles(program, elem, project_path):
building.source_ext = []