Skip to content

Commit

Permalink
Update aksetup
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed May 6, 2024
1 parent e767dbc commit 795ec35
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions aksetup_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,21 @@ def setup(*args, **kwargs):


def get_numpy_incpath():
from os.path import join, dirname
from os.path import join, dirname, exists
from importlib.util import find_spec
origin = find_spec("numpy").origin
if origin is None:
raise RuntimeError("origin of numpy package not found")

pathname = dirname(origin)
return join(pathname, "core", "include")
for p in [
join(pathname, "_core", "include"), # numpy 2 onward
join(pathname, "core", "include"), # numpy prior to 2
]:
if exists(join(p, "numpy", "arrayobject.h")):
return p

raise RuntimeError("no valid path for numpy found")


class NumpyExtension(Extension):
Expand Down Expand Up @@ -643,9 +650,6 @@ def set_up_shipped_boost_if_requested(project_name, conf, source_path=None,
"boost": "%sboost" % project_name,
}

if os.environ.get("MINGW_CHOST"):
defines["BOOST_USE_WINDOWS_H"] = 1

if boost_chrono is False:
defines["BOOST_THREAD_DONT_USE_CHRONO"] = 1
elif boost_chrono == "header_only":
Expand Down

0 comments on commit 795ec35

Please sign in to comment.