File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+
5
+ - Respect ` CARGO_BUILD_TARGET ` environment variable if set. [ #90 ] ( https://github.com/PyO3/setuptools-rust/pull/90 )
6
+
3
7
## 0.11.5 (2020-11-10)
4
8
5
9
- Fix support for Python 3.5. [ #86 ] ( https://github.com/PyO3/setuptools-rust/pull/86 )
Original file line number Diff line number Diff line change @@ -92,10 +92,14 @@ def build_extension(self, ext):
92
92
93
93
# If we are on a 64-bit machine, but running a 32-bit Python, then
94
94
# we'll target a 32-bit Rust build.
95
+ # Automatic target detection can be overridden via the CARGO_BUILD_TARGET
96
+ # environment variable.
95
97
# TODO: include --target for all platforms so env vars can't break the build
96
98
target_triple = None
97
99
target_args = []
98
- if self .plat_name == "win32" :
100
+ if os .getenv ("CARGO_BUILD_TARGET" ):
101
+ target_triple = os .environ ["CARGO_BUILD_TARGET" ]
102
+ elif self .plat_name == "win32" :
99
103
target_triple = "i686-pc-windows-msvc"
100
104
elif self .plat_name == "win-amd64" :
101
105
target_triple = "x86_64-pc-windows-msvc"
You can’t perform that action at this time.
0 commit comments