0

changed setup.py to include numpy include paths

from <https://github.com/agrif/Minecraft-Overviewer/issues/2>
This commit is contained in:
Xon
2011-03-09 19:10:35 -05:00
committed by Aaron Griffith
parent 5852c17ec8
commit 6519d71eaa

View File

@@ -35,8 +35,17 @@ if py2exe != None:
# c_overviewer extension # c_overviewer extension
# #
# Third-party modules - we depend on numpy for everything
import numpy
# Obtain the numpy include directory. This logic works across numpy versions.
try:
numpy_include = numpy.get_include()
except AttributeError:
numpy_include = numpy.get_numpy_include()
c_overviewer_files = ['src/main.c', 'src/composite.c', 'src/iterate.c'] c_overviewer_files = ['src/main.c', 'src/composite.c', 'src/iterate.c']
setup_kwargs['ext_modules'].append(Extension('c_overviewer', c_overviewer_files, include_dirs=['.'], extra_link_args=["/MANIFEST"] if platform.system() == "Windows" else [])) setup_kwargs['ext_modules'].append(Extension('c_overviewer', c_overviewer_files, include_dirs=['.', numpy_include], extra_link_args=["/MANIFEST"] if platform.system() == "Windows" else []))
# tell build_ext to build the extension in-place # tell build_ext to build the extension in-place
# (NOT in build/) # (NOT in build/)
setup_kwargs['options']['build_ext'] = {'inplace' : 1} setup_kwargs['options']['build_ext'] = {'inplace' : 1}