Browse Source

Merge pull request #450 from www220/master

生成vs文件时将区分编译目录,防止同名的源文件不能编译的情况
Bernard Xiong 10 years ago
parent
commit
a3919b90fe
1 changed files with 4 additions and 1 deletions
  1. 4 1
      tools/vs2012.py

+ 4 - 1
tools/vs2012.py

@@ -99,11 +99,14 @@ def VS_add_ItemGroup(parent, file_type, files, project_path):
         name = fn.name
         path = os.path.dirname(fn.abspath)
 
-        path = _make_path_relative(project_path, path)
+        objpath = 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 = []