From 99861c7f3de689b0526a37787745d02b819560f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E4=BF=8A=E9=BA=9F?= Date: Tue, 4 Jul 2023 21:04:37 +0800 Subject: [PATCH] Update setup.py much reasonable and OK for Windows --- custom_mc/setup.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/custom_mc/setup.py b/custom_mc/setup.py index a49f6d1..0addc00 100644 --- a/custom_mc/setup.py +++ b/custom_mc/setup.py @@ -1,13 +1,17 @@ # python setup.py build_ext --inplace -from setuptools import setup +from setuptools import setup, Extension from Cython.Build import cythonize import numpy as np -import os - -includes_numpy = '-I ' + np.get_include() + ' ' -os.environ['CFLAGS'] = includes_numpy + (os.environ['CFLAGS'] if 'CFLAGS' in os.environ else '') setup( name="My MC", - ext_modules=cythonize("_marching_cubes_lewiner_cy.pyx", include_path=[np.get_include()], language="c++"), + ext_modules=cythonize( + Extension( + "_marching_cubes_lewiner_cy", + sources=["_marching_cubes_lewiner_cy.pyx"], + include_dirs=[np.get_include()], + language="c++" + ) + ), + install_requires=["numpy"] )