@@ -138,15 +138,22 @@ class BuildFailed(Exception):
138
138
def __init__ (self , ext ):
139
139
self .ext = ext
140
140
141
+ is_windows = sys .platform .startswith ('win32' )
142
+ is_macos = sys .platform .startswith ('darwin' )
141
143
142
144
murmur3_ext = Extension ('cassandra.cmurmur3' ,
143
145
sources = ['cassandra/cmurmur3.c' ])
144
146
147
+ libev_includes = ['/usr/include/libev' , '/usr/local/include' , '/opt/local/include' , '/usr/include' ]
148
+ libev_libdirs = ['/usr/local/lib' , '/opt/local/lib' , '/usr/lib64' ]
149
+ if is_macos :
150
+ libev_includes .extend (['/opt/homebrew/include' , os .path .expanduser ('~/homebrew/include' )])
151
+ libev_libdirs .extend (['/opt/homebrew/lib' ])
145
152
libev_ext = Extension ('cassandra.io.libevwrapper' ,
146
153
sources = ['cassandra/io/libevwrapper.c' ],
147
- include_dirs = [ '/usr/include/libev' , '/usr/local/include' , '/opt/local/include' , '/opt/homebrew/include' , os . path . expanduser ( '~/homebrew/include' )] ,
154
+ include_dirs = libev_includes ,
148
155
libraries = ['ev' ],
149
- library_dirs = [ '/usr/local/lib' , '/opt/local/lib' ] )
156
+ library_dirs = libev_libdirs )
150
157
151
158
platform_unsupported_msg = \
152
159
"""
@@ -169,8 +176,6 @@ def __init__(self, ext):
169
176
=================================================================================
170
177
"""
171
178
172
- is_windows = os .name == 'nt'
173
-
174
179
is_pypy = "PyPy" in sys .version
175
180
if is_pypy :
176
181
sys .stderr .write (pypy_unsupported_msg )
0 commit comments