From 4a6566ee5d1334daa100976dbc22548bab7dad99 Mon Sep 17 00:00:00 2001 From: Ilya Baryshev Date: Mon, 27 Apr 2015 16:32:33 +0300 Subject: [PATCH] Fix problem compiling package under FreeBSD Fixes #34 Using OS X dirty hack for FreeBSD --- setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 6ba728ae..3e405bc4 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ def spawn(self, cmd): else: flags = ['-fPIC', '-std=c++0x', '-Wall', '-Wno-parentheses'] platform.mac_ver() - if platform.system() == 'Darwin': + if platform.system() in ['Darwin', 'FreeBSD']: os.environ['CC'] = os.environ['CXX'] = 'c++' orig_customize_compiler = distutils.sysconfig.customize_compiler @@ -88,12 +88,13 @@ def customize_compiler(compiler): distutils.sysconfig.customize_compiler = customize_compiler flags.extend([ '-stdlib=libc++', - '-mmacosx-version-min=10.7', ]) - if tuple(map(int, platform.mac_ver()[0].split('.'))) >= (10, 9): - flags.append( - '-Wno-error=unused-command-line-argument-hard-error-in-future', - ) + if platform.system() == 'Darwin': + flags.append('-mmacosx-version-min=10.7',) + if tuple(map(int, platform.mac_ver()[0].split('.'))) >= (10, 9): + flags.append( + '-Wno-error=unused-command-line-argument-hard-error-in-future', + ) # Dirty workaround to avoid link error... # Python distutils doesn't provide any way to configure different # flags for each cc and c++.