Example #1
0
def auto_detect_msvc_compiler(conf, version, target, windows_kit):
    conf.env['MSVC_VERSIONS'] = [version]
    conf.env['MSVC_TARGETS'] = [target]
    vs_version = version.replace('msvc', '').strip()

    # Normalize the input winkit by ensuring its ascii and it has no leading or trailing spaces
    ascii_winkit = windows_kit.encode('utf-8') if isinstance(windows_kit, unicode) else windows_kit
    ascii_winkit = ascii_winkit.strip()

    try:
        # By default use the tool environment cache
        setattr(conf, TOOL_CACHE_ATTR_USE_CACHE_FLAG, True)
        conf.autodetect(ascii_winkit, True)
        conf.find_msvc()
    except:
        cache_read_dict = getattr(conf, TOOL_CACHE_ATTR_READ_DICTIONARY, {})
        if cache_read_dict.get(vs_version, False):
            # If an error occurred trying to detect the compiler and the compiler info was read from the cache, then
            # invalidate the running installed version, turn off the use of the cache, and re-run it
            setattr(conf, TOOL_CACHE_ATTR_USE_CACHE_FLAG, False)
            setattr(conf, TOOL_CACHE_ATTR_READ_DICTIONARY, {})
            global MSVC_INSTALLED_VERSIONS
            MSVC_INSTALLED_VERSIONS[ascii_winkit] = ''

            conf.autodetect(ascii_winkit, True)
            conf.find_msvc()
        else:
            # If the error occurred without using cached information, then just error out, no need to try again
            raise
Example #2
0
def configure(conf):
	conf.autodetect()
	conf.find_msvc()
	conf.msvc_common_flags()
	conf.cc_load_tools()
	conf.cxx_load_tools()
	conf.cc_add_flags()
	conf.cxx_add_flags()
	conf.link_add_flags()
Example #3
0
File: msvc.py Project: jrossi/waf
def configure(conf):
	"""
	Configuration methods to call for detecting msvc
	"""
	conf.autodetect()
	conf.find_msvc()
	conf.msvc_common_flags()
	conf.cc_load_tools()
	conf.cxx_load_tools()
	conf.cc_add_flags()
	conf.cxx_add_flags()
	conf.link_add_flags()
Example #4
0
def configure(conf):
    """
	Configuration methods to call for detecting msvc
	"""
    conf.autodetect(True)
    conf.find_msvc()
    conf.msvc_common_flags()
    conf.cc_load_tools()
    conf.cxx_load_tools()
    conf.cc_add_flags()
    conf.cxx_add_flags()
    conf.link_add_flags()
    conf.visual_studio_add_flags()
Example #5
0
def auto_detect_msvc_compiler(conf, version, target, windows_kit):
    conf.env['MSVC_VERSIONS'] = [version]
    conf.env['MSVC_TARGETS'] = [target]

    conf.autodetect(windows_kit, True)
    conf.find_msvc()