8000 Fix compiler error on Windows · JackLangerman/python_example@22a3c2d · GitHub
[go: up one dir, main page]

Skip to content

Commit 22a3c2d

Browse files
committed
Fix compiler error on Windows
1 parent b6d1cd6 commit 22a3c2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ class BuildExt(build_ext):
7878
def build_extensions(self):
7979
ct = self.compiler.compiler_type
8080
opts = self.c_opts.get(ct, [])
81-
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
8281
if ct == 'unix':
82+
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
8383
opts.append(cpp_flag(self.compiler))
8484
if has_flag(self.compiler, '-fvisibility=hidden'):
8585
opts.append('-fvisibility=hidden')
86+
elif ct == 'msvc':
87+
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
8688
for ext in self.extensions:
8789
ext.extra_compile_args = opts
8890
build_ext.build_extensions(self)

0 commit comments

Comments
 (0)
0