Skip to content

Commit b3ea870

Browse files
committed
Use define_macros for macros (@isuruf, #39)
1 parent 8f86e4c commit b3ea870

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,12 @@ def build_extensions(self):
8383
opts = self.c_opts.get(ct, [])
8484
link_opts = self.l_opts.get(ct, [])
8585
if ct == 'unix':
86-
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
8786
opts.append(cpp_flag(self.compiler))
8887
if has_flag(self.compiler, '-fvisibility=hidden'):
8988
opts.append('-fvisibility=hidden')
90-
elif ct == 'msvc':
91-
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
89+
9290
for ext in self.extensions:
91+
ext.define_macros = [('VERSION_INFO', '"{}"'.format(self.distribution.get_version()))]
9392
ext.extra_compile_args = opts
9493
ext.extra_link_args = link_opts
9594
build_ext.build_extensions(self)

0 commit comments

Comments
 (0)