Skip to content

Commit

Permalink
Include 'Shell32.lib' through pragma rather than linker flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zv committed Feb 13, 2019
1 parent 3ee7bcf commit e25aebf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
import os
import sys

from setuptools import setup, Extension

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

from distutils.core import setup, Extension
sources = [
'src/python/core.c',
'src/libethash/io.c',
Expand Down Expand Up @@ -34,6 +31,7 @@
'src/libethash/util.h',
]

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

ccargs=[
"/Isrc/",
Expand All @@ -44,13 +42,10 @@
"-Wall"
]

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

pyethash = Extension('pyethash',
sources=sources,
depends=depends,
extra_compile_args=ccargs,
extra_link_args=ldargs)
extra_compile_args=ccargs)

setup(
name='pyethash',
Expand Down
2 changes: 2 additions & 0 deletions src/libethash/mmap_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* UnmapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366882(VS.85).aspx
*/

#pragma comment(lib, "Shell32.lib")

#include <io.h>
#include <windows.h>
#include "mmap.h"
Expand Down

0 comments on commit e25aebf

Please sign in to comment.