mirror of
https://github.com/google/re2.git
synced 2025-10-16 22:38:54 +08:00
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:
@@ -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',
|
||||
)
|
||||
|
Reference in New Issue
Block a user