• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python conf.get_msvc_version函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中waflib.Configure.conf.get_msvc_version函数的典型用法代码示例。如果您正苦于以下问题:Python get_msvc_version函数的具体用法?Python get_msvc_version怎么用?Python get_msvc_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_msvc_version函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: gather_icl_versions

def gather_icl_versions(conf, versions):
	"""
	Checks ICL compilers

	:param versions: list to modify
	:type versions: list
	"""
	version_pattern = re.compile('^...?.?\....?.?')
	try:
		all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\C++')
	except WindowsError:
		try:
			all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Intel\\Compilers\\C++')
		except WindowsError:
			return
	index = 0
	while 1:
		try:
			version = _winreg.EnumKey(all_versions, index)
		except WindowsError:
			break
		index = index + 1
		if not version_pattern.match(version):
			continue
		targets = []
		for target,arch in all_icl_platforms:
			try:
				if target=='intel64': targetDir='EM64T_NATIVE'
				else: targetDir=target
				_winreg.OpenKey(all_versions,version+'\\'+targetDir)
				icl_version=_winreg.OpenKey(all_versions,version)
				path,type=_winreg.QueryValueEx(icl_version,'ProductDir')
				if os.path.isfile(os.path.join(path,'bin','iclvars.bat')):
					try:
						targets.append((target,(arch,conf.get_msvc_version('intel',version,target,os.path.join(path,'bin','iclvars.bat')))))
					except conf.errors.ConfigurationError:
						pass
			except WindowsError:
				pass
		for target,arch in all_icl_platforms:
			try:
				icl_version = _winreg.OpenKey(all_versions, version+'\\'+target)
				path,type = _winreg.QueryValueEx(icl_version,'ProductDir')
				if os.path.isfile(os.path.join(path, 'bin', 'iclvars.bat')):
					try:
						targets.append((target, (arch, conf.get_msvc_version('intel', version, target, os.path.join(path, 'bin', 'iclvars.bat')))))
					except conf.errors.ConfigurationError:
						pass
			except WindowsError:
				continue
		major = version[0:2]
		versions.append(('intel ' + major, targets))
开发者ID:GrahamDennis,项目名称:xpdeint,代码行数:52,代码来源:msvc.py


示例2: gather_winphone_targets

def gather_winphone_targets(conf,versions,version,vc_path,vsvars):
	targets=[]
	for target,realtarget in all_msvc_platforms[::-1]:
		try:
			targets.append((target,(realtarget,conf.get_msvc_version('winphone',version,target,vsvars))))
		except conf.errors.ConfigurationError ,e:
			pass
开发者ID:Cactuslegs,项目名称:audacity-of-nope,代码行数:7,代码来源:msvc.py


示例3: gather_wsdk_versions

def gather_wsdk_versions(conf,versions):
	version_pattern=re.compile('^v..?.?\...?.?')
	try:
		all_versions=Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE,'SOFTWARE\\Wow6432node\\Microsoft\\Microsoft SDKs\\Windows')
	except WindowsError:
		try:
			all_versions=Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE,'SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows')
		except WindowsError:
			return
	index=0
	while 1:
		try:
			version=Utils.winreg.EnumKey(all_versions,index)
		except WindowsError:
			break
		index=index+1
		if not version_pattern.match(version):
			continue
		try:
			msvc_version=Utils.winreg.OpenKey(all_versions,version)
			path,type=Utils.winreg.QueryValueEx(msvc_version,'InstallationFolder')
		except WindowsError:
			continue
		if os.path.isfile(os.path.join(path,'bin','SetEnv.cmd')):
			targets=[]
			for target,arch in all_msvc_platforms:
				try:
					targets.append((target,(arch,conf.get_msvc_version('wsdk',version,'/'+target,os.path.join(path,'bin','SetEnv.cmd')))))
				except conf.errors.ConfigurationError:
					pass
			versions.append(('wsdk '+version[1:],targets))
开发者ID:RONNCC,项目名称:pysoy,代码行数:31,代码来源:msvc.py


示例4: gather_msvc_targets

def gather_msvc_targets(conf,versions,version,vc_path):
	targets=[]
	if os.path.isfile(os.path.join(vc_path,'vcvarsall.bat')):
		for target,realtarget in all_msvc_platforms[::-1]:
			try:
				targets.append((target,(realtarget,conf.get_msvc_version('msvc',version,target,os.path.join(vc_path,'vcvarsall.bat')))))
			except conf.errors.ConfigurationError ,e:
				pass
开发者ID:fthgkc,项目名称:mavsim,代码行数:8,代码来源:msvc.py


示例5: gather_msvc_targets

def gather_msvc_targets(conf,versions,version,vc_path):
	targets=[]
	if os.path.isfile(os.path.join(vc_path,'vcvarsall.bat')):
		for target,realtarget in all_msvc_platforms[::-1]:
			try:
				targets.append((target,(realtarget,conf.get_msvc_version('msvc',version,target,os.path.join(vc_path,'vcvarsall.bat')))))
			except conf.errors.ConfigurationError:
				pass
	elif os.path.isfile(os.path.join(vc_path,'Common7','Tools','vsvars32.bat')):
		try:
			targets.append(('x86',('x86',conf.get_msvc_version('msvc',version,'x86',os.path.join(vc_path,'Common7','Tools','vsvars32.bat')))))
		except conf.errors.ConfigurationError:
			pass
	elif os.path.isfile(os.path.join(vc_path,'Bin','vcvars32.bat')):
		try:
			targets.append(('x86',('x86',conf.get_msvc_version('msvc',version,'',os.path.join(vc_path,'Bin','vcvars32.bat')))))
		except conf.errors.ConfigurationError:
			pass
	versions.append(('msvc '+version,targets))
开发者ID:RONNCC,项目名称:pysoy,代码行数:19,代码来源:msvc.py


示例6: gather_winphone_targets

def gather_winphone_targets(conf, versions, version, vc_path, vsvars):
	#Looking for WinPhone compilers
	targets = []
	for target,realtarget in all_msvc_platforms[::-1]:
		try:
			targets.append((target, (realtarget, conf.get_msvc_version('winphone', version, target, vsvars))))
		except conf.errors.ConfigurationError as e:
			pass
	if targets:
		versions.append(('winphone '+ version, targets))
开发者ID:anthonyrisinger,项目名称:zippy,代码行数:10,代码来源:msvc.py


示例7: gather_intel_composer_versions

def gather_intel_composer_versions(conf,versions):
	version_pattern=re.compile('^...?.?\...?.?.?')
	try:
		all_versions=Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE,'SOFTWARE\\Wow6432node\\Intel\\Suites')
	except WindowsError:
		try:
			all_versions=Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE,'SOFTWARE\\Intel\\Suites')
		except WindowsError:
			return
	index=0
	while 1:
		try:
			version=Utils.winreg.EnumKey(all_versions,index)
		except WindowsError:
			break
		index=index+1
		if not version_pattern.match(version):
			continue
		targets=[]
		for target,arch in all_icl_platforms:
			try:
				if target=='intel64':targetDir='EM64T_NATIVE'
				else:targetDir=target
				try:
					defaults=Utils.winreg.OpenKey(all_versions,version+'\\Defaults\\C++\\'+targetDir)
				except WindowsError:
					if targetDir=='EM64T_NATIVE':
						defaults=Utils.winreg.OpenKey(all_versions,version+'\\Defaults\\C++\\EM64T')
					else:
						raise WindowsError
				uid,type=Utils.winreg.QueryValueEx(defaults,'SubKey')
				Utils.winreg.OpenKey(all_versions,version+'\\'+uid+'\\C++\\'+targetDir)
				icl_version=Utils.winreg.OpenKey(all_versions,version+'\\'+uid+'\\C++')
				path,type=Utils.winreg.QueryValueEx(icl_version,'ProductDir')
				batch_file=os.path.join(path,'bin','iclvars.bat')
				if os.path.isfile(batch_file):
					try:
						targets.append((target,(arch,conf.get_msvc_version('intel',version,target,batch_file))))
					except conf.errors.ConfigurationError as e:
						pass
				compilervars_warning_attr='_compilervars_warning_key'
				if version[0:2]=='13'and getattr(conf,compilervars_warning_attr,True):
					setattr(conf,compilervars_warning_attr,False)
					patch_url='http://software.intel.com/en-us/forums/topic/328487'
					compilervars_arch=os.path.join(path,'bin','compilervars_arch.bat')
					for vscomntool in('VS110COMNTOOLS','VS100COMNTOOLS'):
						if vscomntool in os.environ:
							vs_express_path=os.environ[vscomntool]+r'..\IDE\VSWinExpress.exe'
							dev_env_path=os.environ[vscomntool]+r'..\IDE\devenv.exe'
							if(r'if exist "%VS110COMNTOOLS%..\IDE\VSWinExpress.exe"'in Utils.readf(compilervars_arch)and not os.path.exists(vs_express_path)and not os.path.exists(dev_env_path)):
								Logs.warn(('The Intel compilervar_arch.bat only checks for one Visual Studio SKU ''(VSWinExpress.exe) but it does not seem to be installed at %r. ''The intel command line set up will fail to configure unless the file %r''is patched. See: %s')%(vs_express_path,compilervars_arch,patch_url))
			except WindowsError:
				pass
		major=version[0:2]
		versions.append(('intel '+major,targets))
开发者ID:couchjd,项目名称:playground,代码行数:55,代码来源:msvc.py


示例8: gather_wince_targets

def gather_wince_targets(conf,versions,version,vc_path,vsvars,supported_platforms):
	for device,platforms in supported_platforms:
		cetargets=[]
		for platform,compiler,include,lib in platforms:
			winCEpath=os.path.join(vc_path,'ce')
			if not os.path.isdir(winCEpath):
				continue
			try:
				common_bindirs,_1,_2=conf.get_msvc_version('msvc',version,'x86',vsvars)
			except conf.errors.ConfigurationError:
				continue
			if os.path.isdir(os.path.join(winCEpath,'lib',platform)):
				bindirs=[os.path.join(winCEpath,'bin',compiler),os.path.join(winCEpath,'bin','x86_'+compiler)]+common_bindirs
				incdirs=[os.path.join(winCEpath,'include'),os.path.join(winCEpath,'atlmfc','include'),include]
				libdirs=[os.path.join(winCEpath,'lib',platform),os.path.join(winCEpath,'atlmfc','lib',platform),lib]
				cetargets.append((platform,(platform,(bindirs,incdirs,libdirs))))
		if cetargets:
			versions.append((device+' '+version,cetargets))
开发者ID:RONNCC,项目名称:pysoy,代码行数:18,代码来源:msvc.py


示例9: gather_msvc_versions

def gather_msvc_versions(conf, versions):
    """
	Checks SmartPhones SDKs

	:param versions: list to modify
	:type versions: list
	"""
    try:
        ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432node\\Microsoft\\Windows CE Tools\\SDKs")
    except WindowsError:
        try:
            ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows CE Tools\\SDKs")
        except WindowsError:
            ce_sdk = ""
    if ce_sdk:
        supported_wince_platforms = []
        ce_index = 0
        while 1:
            try:
                sdk_device = _winreg.EnumKey(ce_sdk, ce_index)
            except WindowsError:
                break
            ce_index = ce_index + 1
            sdk = _winreg.OpenKey(ce_sdk, sdk_device)
            path, type = _winreg.QueryValueEx(sdk, "SDKRootDir")
            path = str(path)
            path, device = os.path.split(path)
            if not device:
                path, device = os.path.split(path)
            for arch, compiler in all_wince_platforms:
                platforms = []
                if os.path.isdir(os.path.join(path, device, "Lib", arch)):
                    platforms.append(
                        (
                            arch,
                            compiler,
                            os.path.join(path, device, "Include", arch),
                            os.path.join(path, device, "Lib", arch),
                        )
                    )
                if platforms:
                    supported_wince_platforms.append((device, platforms))
                # checks MSVC
    version_pattern = re.compile("^..?\...?")
    detected_versions = []
    for vcver, vcvar in [("VCExpress", "Exp"), ("VisualStudio", "")]:
        try:
            prefix = "SOFTWARE\\Wow6432node\\Microsoft\\" + vcver
            all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, prefix)
        except WindowsError:
            try:
                prefix = "SOFTWARE\\Microsoft\\" + vcver
                all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, prefix)
            except WindowsError:
                continue

        index = 0
        while 1:
            try:
                version = _winreg.EnumKey(all_versions, index)
            except WindowsError:
                break
            index = index + 1
            if not version_pattern.match(version):
                continue
            if version.endswith("Exp"):
                versionnumber = float(version[:-3])
            else:
                versionnumber = float(version)
            detected_versions.append((versionnumber, version, prefix + "\\" + version))

    def fun(tup):
        return tup[0]
        # FIXME sort does not have a key on python 2.3

    detected_versions.sort(key=fun)
    for (v, version, reg) in detected_versions:
        try:
            msvc_version = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, reg + "\\Setup\\VS")
            path, type = _winreg.QueryValueEx(msvc_version, "ProductDir")
            path = str(path)
            targets = []
            if ce_sdk:
                for device, platforms in supported_wince_platforms:
                    cetargets = []
                    for platform, compiler, include, lib in platforms:
                        winCEpath = os.path.join(path, "VC", "ce")
                        if os.path.isdir(winCEpath):
                            try:
                                common_bindirs, _1, _2 = conf.get_msvc_version(
                                    "msvc", version, "x86", os.path.join(path, "Common7", "Tools", "vsvars32.bat")
                                )
                            except conf.errors.ConfigurationError:
                                pass
                            else:
                                if os.path.isdir(os.path.join(winCEpath, "lib", platform)):
                                    bindirs = [
                                        os.path.join(winCEpath, "bin", compiler),
                                        os.path.join(winCEpath, "bin", "x86_" + compiler),
                                    ] + common_bindirs
#.........这里部分代码省略.........
开发者ID:ita1024,项目名称:node,代码行数:101,代码来源:msvc.py


示例10: gather_msvc_versions

def gather_msvc_versions(conf,versions):
	try:
		ce_sdk=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,'SOFTWARE\\Wow6432node\\Microsoft\\Windows CE Tools\\SDKs')
	except WindowsError:
		try:
			ce_sdk=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,'SOFTWARE\\Microsoft\\Windows CE Tools\\SDKs')
		except WindowsError:
			ce_sdk=''
	if ce_sdk:
		supported_wince_platforms=[]
		ce_index=0
		while 1:
			try:
				sdk_device=_winreg.EnumKey(ce_sdk,ce_index)
			except WindowsError:
				break
			ce_index=ce_index+1
			sdk=_winreg.OpenKey(ce_sdk,sdk_device)
			path,type=_winreg.QueryValueEx(sdk,'SDKRootDir')
			path=str(path)
			path,device=os.path.split(path)
			if not device:
				path,device=os.path.split(path)
			for arch,compiler in all_wince_platforms:
				platforms=[]
				if os.path.isdir(os.path.join(path,device,'Lib',arch)):
					platforms.append((arch,compiler,os.path.join(path,device,'Include',arch),os.path.join(path,device,'Lib',arch)))
				if platforms:
					supported_wince_platforms.append((device,platforms))
	version_pattern=re.compile('^..?\...?')
	detected_versions=[]
	for vcver,vcvar in[('VCExpress','Exp'),('VisualStudio','')]:
		try:
			prefix='SOFTWARE\\Wow6432node\\Microsoft\\'+vcver
			all_versions=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,prefix)
		except WindowsError:
			try:
				prefix='SOFTWARE\\Microsoft\\'+vcver
				all_versions=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,prefix)
			except WindowsError:
				continue
		index=0
		while 1:
			try:
				version=_winreg.EnumKey(all_versions,index)
			except WindowsError:
				break
			index=index+1
			if not version_pattern.match(version):
				continue
			if version.endswith('Exp'):
				versionnumber=float(version[:-3])
			else:
				versionnumber=float(version)
			detected_versions.append((versionnumber,version,prefix+"\\"+version))
	def fun(tup):
		return tup[0]
	detected_versions.sort(key=fun)
	for(v,version,reg)in detected_versions:
		try:
			msvc_version=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,reg+"\\Setup\\VS")
			path,type=_winreg.QueryValueEx(msvc_version,'ProductDir')
			path=str(path)
			targets=[]
			if ce_sdk:
				for device,platforms in supported_wince_platforms:
					cetargets=[]
					for platform,compiler,include,lib in platforms:
						winCEpath=os.path.join(path,'VC','ce')
						if os.path.isdir(winCEpath):
							try:
								common_bindirs,_1,_2=conf.get_msvc_version('msvc',version,'x86',os.path.join(path,'Common7','Tools','vsvars32.bat'))
							except conf.errors.ConfigurationError:
								pass
							else:
								if os.path.isdir(os.path.join(winCEpath,'lib',platform)):
									bindirs=[os.path.join(winCEpath,'bin',compiler),os.path.join(winCEpath,'bin','x86_'+compiler)]+common_bindirs
									incdirs=[include,os.path.join(winCEpath,'include'),os.path.join(winCEpath,'atlmfc','include')]
									libdirs=[lib,os.path.join(winCEpath,'lib',platform),os.path.join(winCEpath,'atlmfc','lib',platform)]
									cetargets.append((platform,(platform,(bindirs,incdirs,libdirs))))
					versions.append((device+' '+version,cetargets))
			if os.path.isfile(os.path.join(path,'VC','vcvarsall.bat')):
				for target,realtarget in all_msvc_platforms[::-1]:
					try:
						targets.append((target,(realtarget,conf.get_msvc_version('msvc',version,target,os.path.join(path,'VC','vcvarsall.bat')))))
					except conf.errors.ConfigurationError:
						pass
			elif os.path.isfile(os.path.join(path,'Common7','Tools','vsvars32.bat')):
				try:
					targets.append(('x86',('x86',conf.get_msvc_version('msvc',version,'x86',os.path.join(path,'Common7','Tools','vsvars32.bat')))))
				except conf.errors.ConfigurationError:
					pass
			versions.append(('msvc '+version,targets))
		except WindowsError:
			continue
开发者ID:spo11,项目名称:archlinux,代码行数:95,代码来源:msvc.py


示例11: msvc_thunk

	def msvc_thunk():
		vs = conf.get_msvc_version(compiler, version, bat_target, bat)
		if select:
			return select(vs)
		else:
			return vs
开发者ID:Jajcus,项目名称:jack2,代码行数:6,代码来源:msvc.py



注:本文中的waflib.Configure.conf.get_msvc_version函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python conf.get_python_variables函数代码示例发布时间:2022-05-26
下一篇:
Python conf.get_cc_version函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap