Register the local 32-bit C++ toolchain with highest priority.

Change-Id: I79d52e24ed00e875d1cfbb1f316139ad7639aff6
Reviewed-on: https://code-review.googlesource.com/c/re2/+/62470
Reviewed-by: Paul Wankadia <junyer@google.com>
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
This commit is contained in:
Paul Wankadia
2024-01-18 19:40:35 +00:00
parent e6c83c9028
commit bbfad95445

View File

@@ -56,6 +56,11 @@ class BuildExt(setuptools.command.build_ext.build_ext):
cpu = os.environ['BAZEL_CPU']
cmd.append(f'--cpu={cpu}')
cmd.append(f'--platforms=//python:{cpu}')
if cpu == 'x64_x86_windows':
# Register the local 32-bit C++ toolchain with highest priority.
# (This is likely to break in some release of Bazel after 7.0.0,
# but this special case can hopefully be entirely removed then.)
cmd.append(f'--extra_toolchains=@local_config_cc//:cc-toolchain-{cpu}')
except KeyError:
pass
# Register the local Python toolchain with highest priority.