File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ def check_env(env_name, default):
5959# 32 bit or 64 bit system?
6060BITNESS = struct .calcsize ("P" ) * 8
6161WINDOWS = platform .system () == 'Windows'
62+ MACOS = platform .system () == 'Darwin'
6263
6364include_dirs = []
6465library_dirs = []
@@ -115,11 +116,11 @@ class build_ext(_build_ext):
115116 def build_extensions (self ):
116117 global library_dirs , include_dirs , libraries
117118
119+ extra_cc_args = []
118120 if WINDOWS :
119121 # Detect the compiler so we can specify the correct command line switches
120122 # and libraries
121123 from distutils .cygwinccompiler import Mingw32CCompiler
122- extra_cc_args = []
123124 if isinstance (self .compiler , Mingw32CCompiler ):
124125 # Compiler is Mingw32
125126 extra_cc_args = [
@@ -168,9 +169,13 @@ def build_extensions(self):
168169 libraries .extend ([ 'gssapi_krb5' , 'krb5' ] )
169170 if LINK_OPENSSL and LINK_FREETDS_STATICALLY :
170171 libraries .extend ([ 'ssl' , 'crypto' ])
171-
172+ if MACOS :
173+ extra_cc_args = [
174+ '-Wno-unreachable-code-fallthrough' ,
175+ ]
172176 for e in self .extensions :
173177 e .libraries .extend (libraries )
178+ e .extra_compile_args .extend (extra_cc_args )
174179
175180 _build_ext .build_extensions (self )
176181
You can’t perform that action at this time.
0 commit comments