backends/vs: Set ObjectFileName for generated sources.

When a static library B to a static library A with generated sources, B
directly references the object file corresponding to the generated source in
A. For that reference in B object_filename_from_source() is used.  But A did
not specify the object file name, ending up with cl.exe's default.

Fixes: #9235
pull/9274/head
Andres Freund 3 years ago
parent 4e41a6203f
commit a8370e6d3f
  1. 3
      mesonbuild/backend/vs2010backend.py

@ -1342,6 +1342,8 @@ class Vs2010Backend(backends.Backend):
self.add_additional_options(lang, inc_cl, file_args)
self.add_preprocessor_defines(lang, inc_cl, file_defines)
self.add_include_dirs(lang, inc_cl, file_inc_dirs)
s = File.from_built_file(target.get_subdir(), s)
ET.SubElement(inc_cl, 'ObjectFileName').text = "$(IntDir)" + self.object_filename_from_source(target, s)
for lang in pch_sources:
impl = pch_sources[lang][1]
if impl and path_normalize_add(impl, previous_sources):
@ -1356,6 +1358,7 @@ class Vs2010Backend(backends.Backend):
else:
inc_dirs = file_inc_dirs
self.add_include_dirs(lang, inc_cl, inc_dirs)
#XXX: Do we need to set the object file name name here too?
previous_objects = []
if self.has_objects(objects, additional_objects, gen_objs):

Loading…
Cancel
Save