Visual studio 2013 对visual studio 2013的SCons支持
有人知道SCON何时支持Visual Studio 2013吗 最新版本2.3.1是硬编码的,用于查找6.0到11.0。但是12.0没有条目 VS 2013发布了几个月。我很惊讶这是缺乏的 谢谢Visual studio 2013 对visual studio 2013的SCons支持,visual-studio-2013,scons,Visual Studio 2013,Scons,有人知道SCON何时支持Visual Studio 2013吗 最新版本2.3.1是硬编码的,用于查找6.0到11.0。但是12.0没有条目 VS 2013发布了几个月。我很惊讶这是缺乏的 谢谢 Shane我也在寻找VS 2013(vs12)支持(针对scone 2.3.0),我发现了以下链接: 我对3个文件做了与上面描述的相同的简单更改,瞧,vs12现在可以工作了… 不加标记的回答。结果是,一台只有VS2013的机器出现了问题 我打电话设法解决了这个问题 SCons.Tool.MSCommo
Shane我也在寻找VS 2013(vs12)支持(针对scone 2.3.0),我发现了以下链接: 我对3个文件做了与上面描述的相同的简单更改,瞧,vs12现在可以工作了…
不加标记的回答。结果是,一台只有VS2013的机器出现了问题 我打电话设法解决了这个问题
SCons.Tool.MSCommon.vc.__INSTALLED_VCS_RUN=['12.0']
它起作用了。但这是一种糟糕的做法,我不能真诚地鼓励它
事实证明,官方的支持仍然悬而未决。我已经和开发人员谈过了,他们认为这应该是下一个版本的一部分 就像hplate一样,我为scons找到了一个补丁 这里的代码只支持VS2013 Express。但为VS2013修改它很简单 这很有效。但我不想强迫约300名其他开发人员使用修补版的SCON 幸运的是,我们的构建系统创建了一个环境&根据需要克隆它。我的解决方案
def RegGetValue(root, key, _32bit = True):
"""This utility function returns a value in the registry
without having to open the key first. Only available on
Windows platforms with a version of Python that can read the
registry.
"""
if not SCons.Util.can_read_reg:
print "ERROR: Python cannot read the Windows registry! - Crashing out..."
sys.exit(-1)
p = key.rfind('\\') + 1
keyp = key[:p-1] # -1 to omit trailing slash
val = key[p:]
if _32bit:
flags = 0x20219 # KEY_READ (0x20019), KEY_WOW64_32KEY (0x0200)
else:
flags = 0x20119 # KEY_READ (0x20019), KEY_WOW64_64KEY (0x0100)
try:
k = SCons.Util.RegOpenKeyEx(root, keyp, 0, flags)
except Exception as e:
import traceback
traceback.print_stack()
print "ERROR: Python cannot read the Windows registry (" + key + ")"
print "Please ensure you have the correct Visual Studio, Micrsoft SDK, and .NET installed"
print "Crashing out....."
sys.exit(-1)
return str(SCons.Util.RegQueryValueEx(k,val)[0])
# As of version 2.3.1 scon's does not have built in support for Visual Studio 2013.
# Manually setting the appropriate environmental settings after the env has been created.
# Once scons officially supports 2013 consider removing these.
# HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\InstallPath
# C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
dot_net4_directory = RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Client\\InstallPath", _32bit=False)
# HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VS
# C:\Program Files (x86)\Microsoft Visual Studio 12.0\
vs_2013_directory = RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r"SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VS\\ProductDir")
# HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots\KitsRoot81
# C:\Program Files (x86)\Windows Kits\8.1\
kit8_1_directory = RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r"SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots\\KitsRoot81")
# HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1A\InstallationFolder
# C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\
# Need to investigate if this should be 8.1A
sdk_8_1_directory = RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r"SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1\\InstallationFolder")
LIBPATH = (
dot_net4_directory + ';'
+ vs_2013_directory + 'VC\\LIB\\amd64;'
+ vs_2013_directory + 'VC\\ATLMFC\\LIB\\amd64;'
+ kit8_1_directory + 'References\\CommonConfiguration\\Neutral;'
+ '\\Microsoft.VCLibs\\12.0\\References\\CommonConfiguration\\neutral'
)
LIB = (
vs_2013_directory + 'VC\\LIB\\amd64;'
+ vs_2013_directory + 'VC\\ATLMFC\\LIB\\amd64;'
+ kit8_1_directory + 'lib\\winv6.3\\um\\x64'
)
PATH = (
vs_2013_directory + 'Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;'
+ vs_2013_directory + 'VC\\BIN\\amd64;'
+ dot_net4_directory + ';'
+ vs_2013_directory + 'VC\\VCPackages;'
+ vs_2013_directory + 'Common7\\IDE;'
+ vs_2013_directory + 'Common7\\Tools;'
+ vs_2013_directory + 'Team Tools\\Performance Tools\\x64;'
+ vs_2013_directory + 'Team Tools\\Performance Tools;'
+ kit8_1_directory + 'bin\\x64;'
+ kit8_1_directory + 'bin\\x86;'
+ sdk_8_1_directory + 'bin\\NETFX 4.5.1 Tools\\x64\\;'
+ 'C:\\Windows\\System32'
)
INCLUDE = (
vs_2013_directory + 'VC\\INCLUDE;'
+ vs_2013_directory + 'VC\\ATLMFC\\INCLUDE;'
+ kit8_1_directory + 'include\\shared;'
+ kit8_1_directory + 'include\\um;'
+ kit8_1_directory + 'include\\winrt'
)
# Setup the Visual Studio 2013 variables
# Note: The default 'ENV' values are fine
# on a machine with VS2008 & VS2010 installed
# Unclear about machines with just VS2013.
# Needs investigation.
# env['ENV']['TMP'] = default
# env['ENV']['COMSPEC'] = default
# env['ENV']['TEMP'] = default
# env['ENV']['SystemDrive'] = default
# env['ENV']['PATHEXT'] = default
env['ENV']['LIBPATH'] = LIBPATH
env['ENV']['LIB'] = LIB
env['ENV']['PATH'] = PATH
# env['ENV']['SystemRoot'] = default
env['ENV']['INCLUDE'] = INCLUDE
env['MSVC_VERSION'] = '12.0'
env['GET_MSVSPROJECTSUFFIX'] = '.vcxproj'
env['MSVSPROJECTSUFFIX'] = '.vcxproj'
env['MSVS'] = {'SOLUTIONSUFFIX': '.sln', 'PROJECTSUFFIX': '.vcxproj'}
env['MSVSENCODING'] = 'utf-8'
env['MSVS_VERSION'] = '12.0'
警告:到目前为止,我只在安装了VS2008、VS2010和VS2013的机器上测试过这一点。我将在VS2013专机上测试它,如果有任何问题,我将更新此帖子。FYI。VS2013支持应在下一版本的SCON(又名2.3.2)中提供。拉取请求已合并
Visual Studio现在是最新scons版本的一部分。如果这对您不起作用,我建议查看hplate的答案。截至2014年7月5日,scons 2.3.2已可用。