Improve D link argument handling

pull/4132/head
GoaLitiuM 6 years ago
parent 289c1bf919
commit 6e160995b0
  1. 10
      mesonbuild/backend/backends.py
  2. 7
      mesonbuild/compilers/d.py

@ -591,12 +591,12 @@ class Backend:
for d in deps:
if not (d.is_linkable_target()):
raise RuntimeError('Tried to link with a non-library target "%s".' % d.get_basename())
d_arg = self.get_target_filename_for_linking(d)
if not d_arg:
arg = self.get_target_filename_for_linking(d)
if not arg:
continue
if isinstance(compiler, (compilers.LLVMDCompiler, compilers.DmdDCompiler)):
d_arg = '-L' + d_arg
args.append(d_arg)
if compiler.get_language() == 'd':
arg = '-Wl,' + arg
args.append(arg)
return args
def get_mingw_extra_paths(self, target):

@ -122,9 +122,8 @@ class DCompiler(Compiler):
def get_linker_search_args(self, dirname):
# -L is recognized as "add this to the search path" by the linker,
# while the compiler recognizes it as "pass to linker". So, the first
# -L is for the compiler, telling it to pass the second -L to the linker.
return ['-L=-L' + dirname]
# while the compiler recognizes it as "pass to linker".
return ['-Wl,-L' + dirname]
def get_coverage_args(self):
return ['-cov']
@ -231,7 +230,7 @@ class DCompiler(Compiler):
paths = padding
else:
paths = paths + ':' + padding
return ['-L=-rpath={}'.format(paths)]
return ['-Wl,-rpath={}'.format(paths)]
def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'):
if extra_args is None:

Loading…
Cancel
Save