Beispiel #1
0
def gather_vswhere_versions(conf, versions):
    try:
        import json
    except ImportError:
        Logs.error('Visual Studio 2017 detection requires Python 2.6')
        return

    prg_path = os.environ.get(
        'ProgramFiles(x86)',
        os.environ.get('ProgramFiles', 'C:\\Program Files (x86)'))

    vswhere = os.path.join(prg_path, 'Microsoft Visual Studio', 'Installer',
                           'vswhere.exe')
    args = [vswhere, '-products', '*', '-legacy', '-format', 'json']
    try:
        txt = conf.cmd_and_log(args)
    except Errors.WafError as e:
        Logs.debug('msvc: vswhere.exe failed %s', e)
        return

    if sys.version_info[0] < 3:
        txt = txt.decode(Utils.console_encoding())

    arr = json.loads(txt)
    arr.sort(key=lambda x: x['installationVersion'])
    for entry in arr:
        ver = entry['installationVersion']
        ver = str('.'.join(ver.split('.')[:2]))
        path = str(os.path.abspath(entry['installationPath']))
        if os.path.exists(path) and ('msvc %s' % ver) not in versions:
            conf.gather_msvc_targets(versions, ver, path)
Beispiel #2
0
def gather_vswhere_versions(conf, versions):
	try:
		import json
	except ImportError:
		Logs.error('Visual Studio 2017 detection requires Python 2.6')
		return

	prg_path = os.environ.get('ProgramFiles(x86)', os.environ.get('ProgramFiles', 'C:\\Program Files (x86)'))

	vswhere = os.path.join(prg_path, 'Microsoft Visual Studio', 'Installer', 'vswhere.exe')
	args = [vswhere, '-products', '*', '-legacy', '-format', 'json']
	try:
		txt = conf.cmd_and_log(args)
	except Errors.WafError as e:
		Logs.debug('msvc: vswhere.exe failed %s', e)
		return

	if sys.version_info[0] < 3:
		txt = txt.decode(Utils.console_encoding())

	arr = json.loads(txt)
	arr.sort(key=lambda x: x['installationVersion'])
	for entry in arr:
		ver = entry['installationVersion']
		ver = str('.'.join(ver.split('.')[:2]))
		path = str(os.path.abspath(entry['installationPath']))
		if os.path.exists(path) and ('msvc %s' % ver) not in versions:
			conf.gather_msvc_targets(versions, ver, path)
Beispiel #3
0
def gather_vswhere_versions(conf, versions):
    try:
        import json
    except ImportError:
        Logs.error("Visual Studio 2017 detection requires Python 2.6")
        return

    prg_path = os.environ.get(
        "ProgramFiles(x86)", os.environ.get("ProgramFiles", "C:\\Program Files (x86)")
    )

    vswhere = os.path.join(
        prg_path, "Microsoft Visual Studio", "Installer", "vswhere.exe"
    )
    args = [vswhere, "-products", "*", "-legacy", "-format", "json"]
    try:
        txt = conf.cmd_and_log(args)
    except Errors.WafError as e:
        Logs.debug("msvc: vswhere.exe failed %s", e)
        return

    if sys.version_info[0] < 3:
        txt = txt.decode(Utils.console_encoding())

    arr = json.loads(txt)
    arr.sort(key=lambda x: x["installationVersion"])
    for entry in arr:
        ver = entry["installationVersion"]
        ver = str(".".join(ver.split(".")[:2]))
        path = str(os.path.abspath(entry["installationPath"]))
        if os.path.exists(path) and ("msvc %s" % ver) not in versions:
            conf.gather_msvc_targets(versions, ver, path)
Beispiel #4
0
WSCRIPT_FILE = 'wscript'
"""Name of the waf script files"""

launch_dir = ''
"""Directory from which waf has been called"""
run_dir = ''
"""Location of the wscript file to use as the entry point"""
top_dir = ''
"""Location of the project directory (top), if the project was configured"""
out_dir = ''
"""Location of the build directory (out), if the project was configured"""
waf_dir = ''
"""Directory containing the waf modules"""

default_encoding = Utils.console_encoding()
"""Encoding to use when reading outputs from other processes"""

g_module = None
"""
Module representing the top-level wscript file (see :py:const:`waflib.Context.run_dir`)
"""

STDOUT = 1
STDERR = -1
BOTH = 0

classes = []
"""
List of :py:class:`waflib.Context.Context` subclasses that can be used as waf commands. The classes
are added automatically by a metaclass.
Beispiel #5
0
WSCRIPT_FILE = 'wscript'
"""Name of the waf script files"""

launch_dir = ''
"""Directory from which waf has been called"""
run_dir = ''
"""Location of the wscript file to use as the entry point"""
top_dir = ''
"""Location of the project directory (top), if the project was configured"""
out_dir = ''
"""Location of the build directory (out), if the project was configured"""
waf_dir = ''
"""Directory containing the waf modules"""

default_encoding = Utils.console_encoding()
"""Encoding to use when reading outputs from other processes"""

g_module = None
"""
Module representing the top-level wscript file (see :py:const:`waflib.Context.run_dir`)
"""

STDOUT = 1
STDERR = -1
BOTH   = 0

classes = []
"""
List of :py:class:`waflib.Context.Context` subclasses that can be used as waf commands. The classes
are added automatically by a metaclass.