Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HOMEBREW_PREFIX to locate Homebrew #1212

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,15 @@ def get_compiler_settings(version_str):
'/opt/homebrew/include',
expanduser('~/homebrew/include'),
]
_HOMEBREW_PREFIX = os.environ.get('HOMEBREW_PREFIX')
if _HOMEBREW_PREFIX is not None:
dirs.insert(0, os.path.join(_HOMEBREW_PREFIX, 'include'))
settings['include_dirs'].extend(dir for dir in dirs if isdir(dir))
# unixODBC make/install places libodbc.dylib in /usr/local/lib/ by default
# ( also OS/X since El Capitan prevents /usr/lib from being accessed )
settings['library_dirs'] = ['/usr/local/lib', '/opt/homebrew/lib']
if _HOMEBREW_PREFIX is not None:
settings['library_dirs'].insert(1, os.path.join(_HOMEBREW_PREFIX, 'lib'))
else:
# Other posix-like: Linux, Solaris, etc.

Expand Down