Code cleanup

This commit is contained in:
Thomas Nagy 2016-01-17 14:25:57 +01:00
parent 139b3f7a05
commit 8ffbb6db0a
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 7 additions and 8 deletions

View File

@ -808,7 +808,7 @@ def autodetect(conf, arch = False):
v['MSVC_COMPILER'] = compiler v['MSVC_COMPILER'] = compiler
try: try:
v['MSVC_VERSION'] = float(version) v['MSVC_VERSION'] = float(version)
except Exception: except TypeError:
v['MSVC_VERSION'] = float(version[:-3]) v['MSVC_VERSION'] = float(version[:-3])
def _get_prog_names(conf, compiler): def _get_prog_names(conf, compiler):
@ -853,9 +853,8 @@ def find_msvc(conf):
# linker # linker
if not v['LINK_CXX']: if not v['LINK_CXX']:
link = conf.find_program(linker_name, path_list=path) # TODO: var=LINK_CXX to let so that LINK_CXX can be overridden?
if link: v['LINK_CXX'] = link v.LINK_CXX = conf.find_program(linker_name, path_list=path, errmsg='%s was not found (linker)' % linker_name)
else: conf.fatal('%s was not found (linker)' % linker_name)
if not v['LINK_CC']: if not v['LINK_CC']:
v['LINK_CC'] = v['LINK_CXX'] v['LINK_CC'] = v['LINK_CXX']
@ -880,10 +879,10 @@ def find_msvc(conf):
def visual_studio_add_flags(self): def visual_studio_add_flags(self):
"""visual studio flags found in the system environment""" """visual studio flags found in the system environment"""
v = self.env v = self.env
try: v.prepend_value('INCLUDES', [x for x in self.environ['INCLUDE'].split(';') if x]) # notice the 'S' if self.environ.get('INCLUDE', None):
except Exception: pass v.prepend_value('INCLUDES', [x for x in self.environ['INCLUDE'].split(';') if x]) # notice the 'S'
try: v.prepend_value('LIBPATH', [x for x in self.environ['LIB'].split(';') if x]) if self.environ.get('LIB', None):
except Exception: pass v.prepend_value('LIBPATH', [x for x in self.environ['LIB'].split(';') if x])
@conf @conf
def msvc_common_flags(conf): def msvc_common_flags(conf):