|
|
@ -1474,7 +1474,7 @@ class BuildTarget(Target): |
|
|
|
links_with_rust_abi = isinstance(t, BuildTarget) and t.uses_rust_abi() |
|
|
|
links_with_rust_abi = isinstance(t, BuildTarget) and t.uses_rust_abi() |
|
|
|
if not self.uses_rust() and links_with_rust_abi: |
|
|
|
if not self.uses_rust() and links_with_rust_abi: |
|
|
|
raise InvalidArguments(f'Try to link Rust ABI library {t.name!r} with a non-Rust target {self.name!r}') |
|
|
|
raise InvalidArguments(f'Try to link Rust ABI library {t.name!r} with a non-Rust target {self.name!r}') |
|
|
|
if self.for_machine is not t.for_machine: |
|
|
|
if self.for_machine is not t.for_machine and (not links_with_rust_abi or t.rust_crate_type != 'proc-macro'): |
|
|
|
msg = f'Tried to mix libraries for machines {self.for_machine} and {t.for_machine} in target {self.name!r}' |
|
|
|
msg = f'Tried to mix libraries for machines {self.for_machine} and {t.for_machine} in target {self.name!r}' |
|
|
|
if self.environment.is_cross_build(): |
|
|
|
if self.environment.is_cross_build(): |
|
|
|
raise InvalidArguments(msg + ' This is not possible in a cross build.') |
|
|
|
raise InvalidArguments(msg + ' This is not possible in a cross build.') |
|
|
|