|
|
@ -894,18 +894,6 @@ class Vs2010Backend(backends.Backend): |
|
|
|
dirs = file_inc_dirs[lang] |
|
|
|
dirs = file_inc_dirs[lang] |
|
|
|
ET.SubElement(parent_node, "AdditionalIncludeDirectories").text = ';'.join(dirs) |
|
|
|
ET.SubElement(parent_node, "AdditionalIncludeDirectories").text = ';'.join(dirs) |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|
|
|
|
def has_objects(objects, additional_objects, generated_objects): |
|
|
|
|
|
|
|
# Ignore generated objects, those are automatically used by MSBuild because they are part of |
|
|
|
|
|
|
|
# the CustomBuild Outputs. |
|
|
|
|
|
|
|
return len(objects) + len(additional_objects) > 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|
|
|
|
def add_generated_objects(node, generated_objects): |
|
|
|
|
|
|
|
# Do not add generated objects to project file. Those are automatically used by MSBuild, because |
|
|
|
|
|
|
|
# they are part of the CustomBuild Outputs. |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def escape_preprocessor_define(define: str) -> str: |
|
|
|
def escape_preprocessor_define(define: str) -> str: |
|
|
|
# See: https://msdn.microsoft.com/en-us/library/bb383819.aspx |
|
|
|
# See: https://msdn.microsoft.com/en-us/library/bb383819.aspx |
|
|
@ -1779,17 +1767,20 @@ class Vs2010Backend(backends.Backend): |
|
|
|
for o in custom_objs: |
|
|
|
for o in custom_objs: |
|
|
|
additional_objects.append(o) |
|
|
|
additional_objects.append(o) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# VS automatically links CustomBuild outputs whose name ends in .obj or .res, |
|
|
|
|
|
|
|
# but the others need to be included explicitly |
|
|
|
|
|
|
|
explicit_link_gen_objs = [obj for obj in gen_objs if not obj.endswith(('.obj', '.res'))] |
|
|
|
|
|
|
|
|
|
|
|
previous_objects = [] |
|
|
|
previous_objects = [] |
|
|
|
if self.has_objects(objects, additional_objects, gen_objs): |
|
|
|
if len(objects) + len(additional_objects) + len(explicit_link_gen_objs) > 0: |
|
|
|
inc_objs = ET.SubElement(root, 'ItemGroup') |
|
|
|
inc_objs = ET.SubElement(root, 'ItemGroup') |
|
|
|
for s in objects: |
|
|
|
for s in objects: |
|
|
|
relpath = os.path.join(proj_to_build_root, s.rel_to_builddir(self.build_to_src)) |
|
|
|
relpath = os.path.join(proj_to_build_root, s.rel_to_builddir(self.build_to_src)) |
|
|
|
if path_normalize_add(relpath, previous_objects): |
|
|
|
if path_normalize_add(relpath, previous_objects): |
|
|
|
ET.SubElement(inc_objs, 'Object', Include=relpath) |
|
|
|
ET.SubElement(inc_objs, 'Object', Include=relpath) |
|
|
|
for s in additional_objects: |
|
|
|
for s in additional_objects + explicit_link_gen_objs: |
|
|
|
if path_normalize_add(s, previous_objects): |
|
|
|
if path_normalize_add(s, previous_objects): |
|
|
|
ET.SubElement(inc_objs, 'Object', Include=s) |
|
|
|
ET.SubElement(inc_objs, 'Object', Include=s) |
|
|
|
self.add_generated_objects(inc_objs, gen_objs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') |
|
|
|
ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') |
|
|
|
self.add_regen_dependency(root) |
|
|
|
self.add_regen_dependency(root) |
|
|
|