Skip to content

Commit

Permalink
use Clang to C++-build the Python wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Rusin committed Oct 19, 2023
1 parent bb7de0b commit ecc1ba0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
"win-arm64": "ARM64",
}

if platform.system() == "Darwin":
os.environ["CC"] = "clang"
os.environ["CXX"] = "clang"
os.environ["ARCHFLAGS"] = "-std=c++14"
os.environ["CC"] = "clang"
os.environ["CXX"] = "clang++"
os.environ["CXXFLAGS"] = "-stdlib=libc++"

BASE_DIR = os.path.realpath(os.path.dirname(__file__))
MAKE_DOCS = os.environ.get("MAKE_DOCS")
Expand Down Expand Up @@ -76,6 +75,10 @@ def build_extension(self, ext):
"-DBUILD_DOCS={}".format("ON" if MAKE_DOCS else "OFF"),
"-DBUILD_EXAMPLE=OFF",
"-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm

# Add these lines:
"-DCMAKE_CXX_FLAGS=-stdlib=libc++",
"-DCMAKE_INSTALL_PREFIX=IOHexperimenter",
]
build_args = []

Expand Down

0 comments on commit ecc1ba0

Please sign in to comment.