From cf1ecd2c05e2ad5bea9b49801af12975bc881f20 Mon Sep 17 00:00:00 2001 From: Zephyr Pellerin Date: Wed, 13 Feb 2019 12:34:53 -0800 Subject: [PATCH] Discriminate between platforms when setting compiler flags --- setup.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 18aa20f6..1f643ea2 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,7 @@ #!/usr/bin/env python import os +import sys + from distutils.core import setup, Extension sources = [ 'src/python/core.c', @@ -28,10 +30,22 @@ 'src/libethash/sha3.h', 'src/libethash/util.h', ] + +WIN32 = sys.platform.startswith("win") + +ccargs=[ + "/Isrc/", + "/Wall" +] if WIN32 else [ + "-Isrc/", + "-std=gnu99", + "-Wall" +] + pyethash = Extension('pyethash', sources=sources, depends=depends, - extra_compile_args=["-Isrc/", "-std=gnu99", "-Wall"]) + extra_compile_args=ccargs) setup( name='pyethash',