We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48ab782 commit 060d8b4Copy full SHA for 060d8b4
setuptools_rust/build.py
@@ -92,10 +92,14 @@ def build_extension(self, ext):
92
93
# If we are on a 64-bit machine, but running a 32-bit Python, then
94
# we'll target a 32-bit Rust build.
95
+ # Automatic target detection can be overridden via the CARGO_BUILD_TARGET
96
+ # environment variable.
97
# TODO: include --target for all platforms so env vars can't break the build
98
target_triple = None
99
target_args = []
- 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":
103
target_triple = "i686-pc-windows-msvc"
104
elif self.plat_name == "win-amd64":
105
target_triple = "x86_64-pc-windows-msvc"
0 commit comments