Try plumbing the platform name a different way.

Change-Id: Ic13a6ff61ec445c73483d55241ff42d90f9470b1
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61870
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
This commit is contained in:
Paul Wankadia
2023-09-07 17:51:23 +00:00
parent 33def667c5
commit b1e4fdad75
2 changed files with 17 additions and 11 deletions

View File

@@ -52,8 +52,10 @@ class BuildExt(setuptools.command.build_ext.build_ext):
os.environ['PYTHON_BIN_PATH'] = sys.executable
cmd = ['bazel', 'build']
if 'BAZEL_CPU' in os.environ:
try:
cmd.append(f'--cpu={os.environ["BAZEL_CPU"].lower()}')
except KeyError:
pass
cmd += ['--compilation_mode=opt', '--', ':all']
self.spawn(cmd)
@@ -66,6 +68,15 @@ class BuildExt(setuptools.command.build_ext.build_ext):
self.spawn(cmd)
def options():
bdist_wheel = {}
try:
bdist_wheel['plat_name'] = os.environ['PLAT_NAME']
except KeyError:
pass
return {'bdist_wheel': bdist_wheel}
def include_dirs():
try:
import pybind11
@@ -100,6 +111,7 @@ setuptools.setup(
'Programming Language :: C++',
'Programming Language :: Python :: 3.8',
],
options=options(),
cmdclass={'build_ext': BuildExt},
python_requires='~=3.8',
)