comparison setup.py @ 33865:af20468eb0a4

merge with stable
author Sean Farley <sean@farley.io>
date Mon, 21 Aug 2017 21:35:06 -0700
parents 0f4ac3b6dee4 7686cbb0ba41
children 765eb17a7eb8
comparison
equal deleted inserted replaced
33864:70354bd4f19b 33865:af20468eb0a4
783 783
784 try: 784 try:
785 from distutils import cygwinccompiler 785 from distutils import cygwinccompiler
786 786
787 # the -mno-cygwin option has been deprecated for years 787 # the -mno-cygwin option has been deprecated for years
788 compiler = cygwinccompiler.Mingw32CCompiler 788 mingw32compilerclass = cygwinccompiler.Mingw32CCompiler
789 789
790 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler): 790 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
791 def __init__(self, *args, **kwargs): 791 def __init__(self, *args, **kwargs):
792 compiler.__init__(self, *args, **kwargs) 792 mingw32compilerclass.__init__(self, *args, **kwargs)
793 for i in 'compiler compiler_so linker_exe linker_so'.split(): 793 for i in 'compiler compiler_so linker_exe linker_so'.split():
794 try: 794 try:
795 getattr(self, i).remove('-mno-cygwin') 795 getattr(self, i).remove('-mno-cygwin')
796 except ValueError: 796 except ValueError:
797 pass 797 pass
808 # Allow compiler/linker flags to be added to Visual Studio builds. Passing 808 # Allow compiler/linker flags to be added to Visual Studio builds. Passing
809 # extra_link_args to distutils.extensions.Extension() doesn't have any 809 # extra_link_args to distutils.extensions.Extension() doesn't have any
810 # effect. 810 # effect.
811 from distutils import msvccompiler 811 from distutils import msvccompiler
812 812
813 compiler = msvccompiler.MSVCCompiler 813 msvccompilerclass = msvccompiler.MSVCCompiler
814 814
815 class HackedMSVCCompiler(msvccompiler.MSVCCompiler): 815 class HackedMSVCCompiler(msvccompiler.MSVCCompiler):
816 def initialize(self): 816 def initialize(self):
817 compiler.initialize(self) 817 msvccompilerclass.initialize(self)
818 # "warning LNK4197: export 'func' specified multiple times" 818 # "warning LNK4197: export 'func' specified multiple times"
819 self.ldflags_shared.append('/ignore:4197') 819 self.ldflags_shared.append('/ignore:4197')
820 self.ldflags_shared_debug.append('/ignore:4197') 820 self.ldflags_shared_debug.append('/ignore:4197')
821 821
822 msvccompiler.MSVCCompiler = HackedMSVCCompiler 822 msvccompiler.MSVCCompiler = HackedMSVCCompiler