Skip to content

Commit

Permalink
Guard against conda-build not conda
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert committed Sep 16, 2024
1 parent eae2c52 commit cc25532
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ def build_extensions(self):
cwd=FASTJET,
)

# Hack to inject the required CXXFLAGS and LDFLAGS for building
# on macOS aarch64.
# Inject the required CXXFLAGS and LDFLAGS for building on
# aarch64 macOS. As Homebrew can not be used at any part in a
# conda-forge build, guard against this by checking for the
# conda-build environment variable.
# This is a bad hack, and will be alleviated if CMake can be used
# by FastJet and FastJet-contrib.
# c.f. https://github.com/scikit-hep/fastjet/issues/310
if (
sys.platform == "darwin"
and platform.processor() == "arm"
and "HOMEBREW_PREFIX" in os.environ
and "CONDA_PREFIX" not in os.environ
and "CONDA_BUILD" not in os.environ
):
os.environ["CXXFLAGS"] = (
os.environ.get("CXXFLAGS", "")
Expand Down

0 comments on commit cc25532

Please sign in to comment.