Skip to content

Commit

Permalink
Make it work with the VS backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Feb 12, 2019
1 parent 6097a16 commit 2cd1079
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
19 changes: 19 additions & 0 deletions mesonbuild/backend/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,3 +1219,22 @@ def get_introspection_data(self, target_id, target):
}]

return []

def get_export_symbol_file_args(self, linker, target, *, absolute_paths=False):
args = []
dep_files = []
for f in target.symbol_export_files:
if isinstance(f, File):
relpath = f.rel_to_builddir(self.build_to_src)
elif isinstance(f, build.CustomTarget):
relpath = self.get_target_filename(f)
else:
raise RuntimeError('Broken, please file a bug.')
if absolute_paths:
final_path = os.path.join(self.build_dir, relpath)
else:
final_path = relpath
args += linker.get_symbol_export_file_args(final_path)
dep_files.append(relpath)
return (args, dep_files)

14 changes: 0 additions & 14 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2464,20 +2464,6 @@ def guess_external_link_dependencies(self, linker, target, commands, internal):

return guessed_dependencies + absolute_libs

def get_export_symbol_file_args(self, linker, target):
args = []
dep_files = []
for f in target.symbol_export_files:
if isinstance(f, File):
relpath = f.rel_to_builddir(self.build_to_src)
elif isinstance(f, build.CustomTarget):
relpath = self.get_target_filename(f)
else:
raise RuntimeError('Broken, please file a bug.')
args += linker.get_symbol_export_file_args(relpath)
dep_files.append(relpath)
return (args, dep_files)

def generate_link(self, target, outfile, outname, obj_list, linker, extra_args=[], stdlib_args=[]):
if isinstance(target, build.StaticLibrary):
linker_base = 'STATIC'
Expand Down
3 changes: 3 additions & 0 deletions mesonbuild/backend/vs2010backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,9 @@ def gen_vcxproj(self, target, ofname, guid):
extra_link_args += compiler.get_option_link_args(self.environment.coredata.compiler_options[for_machine])
(additional_libpaths, additional_links, extra_link_args) = self.split_link_args(extra_link_args.to_native())

unquoted_args, _ = self.get_export_symbol_file_args(compiler, target, absolute_paths=True)
extra_link_args += ['"{}"'.format(x) for x in unquoted_args]

# Add more libraries to be linked if needed
for t in target.get_dependencies():
lobj = self.build.targets[t.get_id()]
Expand Down

0 comments on commit 2cd1079

Please sign in to comment.