Skip to content

Commit

Permalink
Update build_ext.py
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Oct 5, 2024
1 parent 4613827 commit 580cab2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,19 @@ def build_extension(debug: bool = False, use_temp_dir=False) -> None:
debug = int(os.environ.get("DEBUG", 0)) or debug
cfg = "Debug" if debug else "Release"

py_cfg = get_py_config()

cmake_args = [
f"-DPython3_EXECUTABLE={py_cfg['exe']}",
f"-DPython3_INCLUDE_DIR={py_cfg['include']}",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
]
if py_cfg["libdir"]:
cmake_args.append(f"-DPython3_LIBRARY={str(Path(py_cfg['libdir']) / Path(py_cfg['library']))}")

if uname.system != "Windows":
py_cfg = get_py_config()
cmake_args.extend(
[
f"-DPython3_EXECUTABLE={py_cfg['exe']}",
f"-DPython3_INCLUDE_DIR={py_cfg['include']}",
]
)
if py_cfg["libdir"]:
cmake_args.append(f"-DPython3_LIBRARY={str(Path(py_cfg['libdir']) / Path(py_cfg['library']))}")
build_args = ["--config Release", "--verbose"]

if sys.platform.startswith("darwin"):
Expand Down

0 comments on commit 580cab2

Please sign in to comment.