|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import os
|
|
|
|
|
import re
|
|
|
|
|
import sys
|
|
|
|
|
import glob
|
|
|
|
|
import subprocess
|
|
|
|
@ -84,6 +85,12 @@ class CMakeBuild(build_ext):
|
|
|
|
|
]
|
|
|
|
|
build_args += ["--config", cfg]
|
|
|
|
|
|
|
|
|
|
if sys.platform.startswith("darwin"):
|
|
|
|
|
# Cross-compile support for macOS - respect ARCHFLAGS if set
|
|
|
|
|
archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", ""))
|
|
|
|
|
if archs:
|
|
|
|
|
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]
|
|
|
|
|
|
|
|
|
|
# Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level
|
|
|
|
|
# across all generators.
|
|
|
|
|
if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ:
|
|
|
|
|