From 6283eaf93085bcb6bb19a2f5fadd3dd4a6551cbc Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 20 Feb 2019 17:32:55 -0600 Subject: [PATCH 1/2] Use proper options for flags --- setup.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index a0db45c..f73f83a 100644 --- a/setup.py +++ b/setup.py @@ -71,22 +71,29 @@ class BuildExt(build_ext): 'msvc': ['/EHsc'], 'unix': [], } + l_opts = { + 'msvc': [], + 'unix': [], + } if sys.platform == 'darwin': + l_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7'] c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7'] def build_extensions(self): ct = self.compiler.compiler_type - opts = self.c_opts.get(ct, []) + c_opts = self.c_opts.get(ct, []) + l_opts = self.l_opts.get(ct, []) if ct == 'unix': - opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version()) - opts.append(cpp_flag(self.compiler)) + c_opts.append(cpp_flag(self.compiler)) if has_flag(self.compiler, '-fvisibility=hidden'): - opts.append('-fvisibility=hidden') - elif ct == 'msvc': - opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version()) + c_opts.append('-fvisibility=hidden') + for ext in self.extensions: - ext.extra_compile_args = opts + ext.extra_compile_args = c_opts + ext.extra_link_args = l_opts + ext.define_macros = [('VERSION_INFO', '"{}"'.format(self.distribution.get_version()))] + build_ext.build_extensions(self) setup( From 4c696d450c7e1c3c59e359bad8dd0b338b46b8bb Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 8 Apr 2020 21:08:29 -0500 Subject: [PATCH 2/2] Fix merge conflict again --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a59b6dc..3d2ae0b 100644 --- a/setup.py +++ b/setup.py @@ -86,9 +86,9 @@ def build_extensions(self): opts = self.c_opts.get(ct, []) link_opts = self.l_opts.get(ct, []) if ct == 'unix': - c_opts.append(cpp_flag(self.compiler)) + opts.append(cpp_flag(self.compiler)) if has_flag(self.compiler, '-fvisibility=hidden'): - c_opts.append('-fvisibility=hidden') + opts.append('-fvisibility=hidden') for ext in self.extensions: ext.define_macros = [('VERSION_INFO', '"{}"'.format(self.distribution.get_version()))]