Skip to content

Commit cb18f07

Browse files
committed
feat(android): set the Cargo target linker
1 parent 37fc0f0 commit cb18f07

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cibuildwheel/platforms/android.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,16 @@ def setup_rust_cross_compile(
406406
log.notice("Not overriding CARGO_BUILD_TARGET as it has already been set")
407407
# No message if it was set to what we were planning to set it to
408408
elif cargo_target:
409-
cargo_target_linker_env_name = f"CARGO_TARGET_{cargo_target.upper().replace('-', '_')}_LINKER"
410-
log.notice(f"Setting CARGO_BUILD_TARGET={cargo_target} and setting {cargo_target_linker_env_name} for cross-compilation")
409+
cargo_target_linker_env_name = (
410+
f"CARGO_TARGET_{cargo_target.upper().replace('-', '_')}_LINKER"
411+
)
412+
log.notice(
413+
f"Setting CARGO_BUILD_TARGET={cargo_target} and setting {cargo_target_linker_env_name} for cross-compilation"
414+
)
411415
env["CARGO_BUILD_TARGET"] = cargo_target
412-
env["cargo_target_linker_env_name"] = os.environ.get("CC")
416+
env[f"{cargo_target_linker_env_name}"] = os.environ.get("CC")
417+
log.info(f"export CARGO_BUILD_TARGET={cargo_target}")
418+
log.info(f"export {cargo_target_linker_env_name}={os.environ.get('CC')}")
413419
else:
414420
log.warning(f"Unable to configure Rust cross-compilation for architecture {cargo_target}")
415421

0 commit comments

Comments
 (0)