From 8362806addddd4e4074ef3468381f0728b0aafa8 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 19 Jul 2021 11:34:55 +0800 Subject: [PATCH] Fix building pip packages on macOS. --- cmake/cmake_extension.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/cmake_extension.py b/cmake/cmake_extension.py index 1133c25..ceb0d61 100644 --- a/cmake/cmake_extension.py +++ b/cmake/cmake_extension.py @@ -2,6 +2,7 @@ import glob import os +import platform import shutil import sys from pathlib import Path @@ -15,6 +16,10 @@ def is_for_pypi(): return ans is not None +def is_macos(): + return platform.system() == "Darwin" + + try: from wheel.bdist_wheel import bdist_wheel as _bdist_wheel @@ -23,7 +28,7 @@ try: _bdist_wheel.finalize_options(self) # In this case, the generated wheel has a name in the form # k2-xxx-pyxx-none-any.whl - if is_for_pypi(): + if is_for_pypi() and not is_macos(): self.root_is_pure = True else: # The generated wheel has a name ending with