|
|
|
@ -1598,6 +1598,7 @@ int dummy; |
|
|
|
|
args += rustc.get_output_args(os.path.join(target.subdir, target.get_filename())) |
|
|
|
|
args += self.environment.coredata.get_external_args(target.for_machine, rustc.language) |
|
|
|
|
linkdirs = mesonlib.OrderedSet() |
|
|
|
|
external_deps = target.external_deps.copy() |
|
|
|
|
for d in target.link_targets: |
|
|
|
|
linkdirs.add(d.subdir) |
|
|
|
|
if d.uses_rust(): |
|
|
|
@ -1609,6 +1610,22 @@ int dummy; |
|
|
|
|
# Rust uses -l for non rust dependencies, but we still need to add (shared|static)=foo |
|
|
|
|
_type = 'static' if d.typename == 'static library' else 'shared' |
|
|
|
|
args += ['-l', f'{_type}={d.name}'] |
|
|
|
|
if d.typename == 'static library': |
|
|
|
|
external_deps.extend(d.external_deps) |
|
|
|
|
for e in external_deps: |
|
|
|
|
for a in e.get_link_args(): |
|
|
|
|
if a.endswith(('.dll', '.so', '.dylib')): |
|
|
|
|
dir_, lib = os.path.split(a) |
|
|
|
|
linkdirs.add(dir_) |
|
|
|
|
lib, ext = os.path.splitext(lib) |
|
|
|
|
if lib.startswith('lib'): |
|
|
|
|
lib = lib[3:] |
|
|
|
|
args.extend(['-l', f'dylib={lib}']) |
|
|
|
|
elif a.startswith('-L'): |
|
|
|
|
args.append(a) |
|
|
|
|
elif a.startswith('-l'): |
|
|
|
|
# This should always be a static lib, I think |
|
|
|
|
args.extend(['-l', f'static={a[2:]}']) |
|
|
|
|
for d in linkdirs: |
|
|
|
|
if d == '': |
|
|
|
|
d = '.' |
|
|
|
|