Skip to content

Commit 18a161a

Browse files
committed
Fix windows
1 parent 17217c9 commit 18a161a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from setuptools import Extension, setup
66

77
# No ZIP support for windows, building with zlib is a pain
8-
ZIP_SUPPORT = platform.system() != "Windows"
8+
WINDOWS = platform.system() == "Windows"
9+
ZIP_SUPPORT = not WINDOWS
910

1011

1112
def get_extensions() -> list[Extension]:
@@ -37,6 +38,11 @@ def get_extensions() -> list[Extension]:
3738
"gambatte-core/libgambatte/include",
3839
]
3940

41+
extra_compile_args = ["-DHAVE_STDINT_H", "-DREVISION=0"]
42+
if WINDOWS:
43+
# This relaxes MSVC's strictness to match GCC/Clang behavior
44+
extra_compile_args.append("/permissive")
45+
4046
gambatte_extension = Extension(
4147
"gambaterm.libgambatte",
4248
language="c++",
@@ -45,7 +51,7 @@ def get_extensions() -> list[Extension]:
4551
"libgambatte_ext",
4652
numpy.get_include(),
4753
],
48-
extra_compile_args=["-DHAVE_STDINT_H", "-DREVISION=0"],
54+
extra_compile_args=extra_compile_args,
4955
libraries=libraries,
5056
sources=[
5157
*libgambatte_sources,

0 commit comments

Comments
 (0)