From 78883650cd1a2fffce68614d203ce6f4f1131dae Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 23 Oct 2013 02:04:44 +0200 Subject: [PATCH] setup: fix for allowing msvc compiler to works, tested on clean window seven + python 2.7 + vc++2008 + glew. closes #493 --- setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 55a67e95d..5548979c2 100644 --- a/setup.py +++ b/setup.py @@ -75,7 +75,6 @@ else: if not have_cython: from distutils.command.build_ext import build_ext - # ----------------------------------------------------------------------------- # Setup classes @@ -100,6 +99,12 @@ class KivyBuildExt(build_ext): fd.write('DEF {0} = {1}\n'.format(k.upper(), int(v))) fd.write('DEF PY3 = {0}\n'.format(int(PY3))) + c = self.compiler.compiler_type + print('Detected compiler is {}'.format(c)) + if c != 'msvc': + for e in self.extensions: + e.extra_link_args += ['-lm'] + build_ext.build_extensions(self) @@ -198,7 +203,7 @@ def merge(d1, *args): def determine_base_flags(): flags = { - 'libraries': ['m'], + 'libraries': [], 'include_dirs': [], 'extra_link_args': [], 'extra_compile_args': []} @@ -399,7 +404,7 @@ if c_options['use_x11']: base_flags, gl_flags, graphics_flags, { 'depends': [join(dirname(__file__), 'kivy/core/window/window_x11_core.c')], - 'libraries': ['Xrender', 'X11', 'm'] + 'libraries': ['Xrender', 'X11'] })