Skip to content

Commit

Permalink
Set extra compiler and linker flags on platform
Browse files Browse the repository at this point in the history
  • Loading branch information
zv committed Feb 7, 2019
1 parent 5220a95 commit ab017f4
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import sys

from setuptools import setup, Extension

WIN32 = sys.platform.startswith("win")

sources = [
'src/python/core.c',
'src/libethash/io.c',
Expand Down Expand Up @@ -30,11 +33,24 @@
'src/libethash/sha3.h',
'src/libethash/util.h',
]


ccargs=[
"-Isrc/",
"-Wall"
] if WIN32 else [
"-Isrc/",
"-std=gnu99",
"-Wall"
]

ldargs=["shell32.lib"] if WIN32 else []

pyethash = Extension('pyethash',
sources=sources,
depends=depends,
extra_compile_args=["-Isrc/", "-std=gnu99"],
extra_link_args=["shell32.lib"] if sys.platform.startswith("win") else [])
extra_compile_args=ccargs,
extra_link_args=ldargs)

setup(
name='pyethash',
Expand Down

0 comments on commit ab017f4

Please sign in to comment.