Skip to content

Commit 17dc80e

Browse files
malfetNicolasHug
andauthored
[Build] Add homebrew as library search location (#9027)
Co-authored-by: Nicolas Hug <[email protected]> Co-authored-by: Nicolas Hug <[email protected]>
1 parent f20bf22 commit 17dc80e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

setup.py

+8
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@ def find_library(header):
271271
return True, None, None
272272
print(f"{searching_for}. Didn't find in {prefix}")
273273

274+
if sys.platform == "darwin":
275+
HOMEBREW_PATH = Path("/opt/homebrew")
276+
include_dir = HOMEBREW_PATH / "include"
277+
library_dir = HOMEBREW_PATH / "lib"
278+
if (include_dir / header).exists():
279+
print(f"{searching_for}. Found in {include_dir}.")
280+
return True, str(include_dir), str(library_dir)
281+
274282
return False, None, None
275283

276284

0 commit comments

Comments
 (0)