Skip to content

Commit

Permalink
Set MACOSX_DEPLOYMENT_TARGET
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxu committed Jan 23, 2024
1 parent e55dc11 commit 354ce05
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ def build_extension(self, ext: CMakeExtension) -> None:
if "universal2" in self.plat_name:
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"]

# Set MACOSX_DEPLOYMENT_TARGET for macOS builds.
if (
self.plat_name.startswith("macosx-")
and "MACOSX_DEPLOYMENT_TARGET" not in os.environ
):
target_version = self.plat_name.split("-")[1]
os.environ["MACOSX_DEPLOYMENT_TARGET"] = target_version

# Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level
# across all generators.
if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ:
Expand Down

0 comments on commit 354ce05

Please sign in to comment.