Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Respect `CARGO_BUILD_TARGET` environment variable if set. [#90](https://github.com/PyO3/setuptools-rust/pull/90)

## 0.11.5 (2020-11-10)

- Fix support for Python 3.5. [#86](https://github.com/PyO3/setuptools-rust/pull/86)
Expand Down
6 changes: 5 additions & 1 deletion setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ def build_extension(self, ext):

# If we are on a 64-bit machine, but running a 32-bit Python, then
# we'll target a 32-bit Rust build.
# Automatic target detection can be overridden via the CARGO_BUILD_TARGET
# environment variable.
# TODO: include --target for all platforms so env vars can't break the build
target_triple = None
target_args = []
if self.plat_name == "win32":
if os.getenv("CARGO_BUILD_TARGET"):
target_triple = os.environ["CARGO_BUILD_TARGET"]
elif self.plat_name == "win32":
target_triple = "i686-pc-windows-msvc"
elif self.plat_name == "win-amd64":
target_triple = "x86_64-pc-windows-msvc"
Expand Down