Skip to content

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapriot committed Mar 16, 2023
1 parent 5687398 commit 2c05f80
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"discretize._extensions.tree_ext",
["discretize/_extensions/tree_ext.pyx", "discretize/_extensions/tree.cpp"],
include_dirs=[np.get_include()],
#extra_compile_args=["-std:c++17", "-std=c++17"],
**ext_kwargs
),
Extension(
Expand All @@ -111,17 +110,20 @@ def build_extension(self, ext):
# This module requires c++17 standard
if ext.name == "discretize._extensions.tree_ext":
comp_type = self.compiler.compiler_type
if comp_type == 'msvc':
std_arg = "\std:c++17"
elif comp_type == 'bcpp':
raise Exception('Must use cpp compiler that support C++17 standard.')
if comp_type == "msvc":
std_arg = "/std:c++17"
elif comp_type == "bcpp":
raise Exception(
"Must use cpp compiler that support C++17 standard."
)
else:
std_arg = "-std=c++17"
ext.extra_compile_args = [std_arg,]
ext.extra_compile_args = [
std_arg,
]
super().build_extension(ext)


metadata["ext_modules"] = cythonize(extensions)
metadata["cmdclass"] = {"build_ext":build_ext_cpp_standard}
metadata["cmdclass"] = {"build_ext": build_ext_cpp_standard}

setup(**metadata)

0 comments on commit 2c05f80

Please sign in to comment.