Skip to content

Commit d14dc1b

Browse files
committed
BLD: allow different options for compiler warnings on windows
Author: Jeff Reback <jeff@reback.net> Closes #12590 from jreback/warnings2 and squashes the following commits: e2b138a [Jeff Reback] BLD: allow different options for compiler warnings on windows
1 parent 71b7237 commit d14dc1b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

setup.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
import platform
1515
from distutils.version import LooseVersion
1616

17+
def is_platform_windows():
18+
return sys.platform == 'win32' or sys.platform == 'cygwin'
19+
20+
def is_platform_linux():
21+
return sys.platform == 'linux2'
22+
23+
def is_platform_mac():
24+
return sys.platform == 'darwin'
25+
1726
# versioning
1827
import versioneer
1928
cmdclass = versioneer.get_cmdclass()
@@ -376,7 +385,10 @@ def pxd(name):
376385
return os.path.abspath(pjoin('pandas', name + '.pxd'))
377386

378387
# args to ignore warnings
379-
extra_compile_args=['-Wno-unused-function']
388+
if is_platform_windows():
389+
extra_compile_args=[]
390+
else:
391+
extra_compile_args=['-Wno-unused-function']
380392

381393
lib_depends = lib_depends + ['pandas/src/numpy_helper.h',
382394
'pandas/src/parse_helper.h']
@@ -388,7 +400,7 @@ def pxd(name):
388400

389401

390402
# some linux distros require it
391-
libraries = ['m'] if 'win32' not in sys.platform else []
403+
libraries = ['m'] if not is_platform_windows() else []
392404

393405
ext_data = dict(
394406
lib={'pyxfile': 'lib',

0 commit comments

Comments
 (0)