Skip to content

Commit 8790f77

Browse files
committed
Add -Wno-unreachable-code-fallthrough for MACOS.
1 parent 4f52708 commit 8790f77

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def check_env(env_name, default):
5959
# 32 bit or 64 bit system?
6060
BITNESS = struct.calcsize("P") * 8
6161
WINDOWS = platform.system() == 'Windows'
62+
MACOS = platform.system() == 'Darwin'
6263

6364
include_dirs = []
6465
library_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

0 commit comments

Comments
 (0)