|
Visual Studio 博客
官方来源的产品从 Visual Studio 工程团队的洞察力
Visual C++ 2012 支持Windows XP
与 Visual Studio 到 2012 年,我们努力在所有 Microsoft 平台提供最佳的发展经验。这包括使开发人员能够给生活带来丰富的 Windows 桌面应用程序-,是否你正在学习构建您的第一个应用程序或是否已经拟定在 Microsoft 平台上很多年。
几个星期前,我们分享我们的 Visual Studio 2012 速成版的计划。正如我们已经提供 Visual studio 的最佳体验,我们与 Windows 8,Windows Phone 的平台和 Web 和 Windows Azure,我们听到我们开发人员要有为 Windows 桌面开发同样伟大的经验和获得最新的 Visual Studio 2012 功能快递一级的社会。
今天,我高兴地宣布我们将添加用于 Windows 桌面 Visual Studio 表示 2012年到 Visual Studio 2012 家庭。这将使 Visual Studio 速成家庭重要新功能,我们已经为建设伟大的桌面应用程序可用 Visual Studio 2012 年。
秉承我们为我们的快递产品而设置的核心原则,Windows 桌面的 Visual Studio 表示 2012年将为开发桌面应用程序的目标在所有支持的 Visual Studio 2012 的 Windows 版本上运行的 Windows 提供简单的、 端到端的发展经验。这个新的速成版,开发人员将能够使用 c + +、 C# 或 Visual Basic 创建 Windows 桌面和控制台应用程序。开发人员也将获得新进展可获得整个快递大家庭
Visual Studio 2012 年最新的编译器和编程语言工具、 综合的单元测试和小的开发团队能力合作,通过团队资源管理器和 TFS 快递等。
计划在秋季发布,Windows 桌面的 Visual Studio 表示 2012年将为学生和其他新的开发人员入门提供一个好的学习环境。它将使现有的开发人员能够带来的最新工具集与他们的桌面应用程序的无摩擦的解决方案。它将使开放源代码目标现有和以前版本的 Windows 应用程序开发人员。
桌面发展一直是 Windows 的核心部分。与 Visual Studio 2012 年我们继续扩展这些桌面开发能力和构建桌面应用程序的开发人员提供很大的发展经验。
这厢有礼了 !
Somasegar
设置编绎器选项,让VC++ 2012 开发的程序支持windows xp
--------------------------------------------------------------------------------------------------------- Hello, my name is Li Shao. I am a Software Design Engineer in Test on the C++ team. For the past two years, I have been part of the team working on migrating the C++ build system from VCBuild to MSBuild as well as the new project system which is also
built on top of MSBuild. You can see one of my earlier blogs about the task work that we have done. In this
blog, I am going to give an overview of the Native Multi-targeting feature. I hope you will find it useful.
Multi-targeting is the ability to use the current version of Visual Studio to build your application with adifferent set of installed tools or Frameworks. In VS2010, C++ applications support two types of Multi-targeting: Native Multi-targeting
and Managed Multi-targeting. For more details on Managed Multi-targeting, please visitthis blog post
by one of my colleagues, Pavan Adharapurapu.
Native Multi-targeting
VS2010 can support building against VS2008 toolsets if VS2008 is installed on the same machine. Soma has mentioned this feature in hisblog some time ago. This feature enables the C++ customers to
use VS2008 toolsets while working in the VS2010 environment. Note that your application created with earlier versions of Visual Studio will need to be converted to the VS2010 version." _msthash="1688195" _mstchunk="true">VS2010 can support building
against VS2008 toolsets if VS2008 is installed on the same machine. Soma has mentioned this feature in hisblog
some time ago. This feature enables the C++ customers to use VS2008 toolsets while working in the VS2010 environment. Note that your application created with earlier versions of Visual Studio will need to be converted to the VS2010 version.
Why Native Multi-targeting?
An important scenario for C++ customers (let’s call them “large C++ shops” here) is that they develop and build their applications in Visual Studio and then ship the applications to their respective customers. These customers, however, maybe using
different versions of Visual Studio for development. Given that, the “large C++ shops” have to keep multiple versions of Visual Studio and multiple versions of the project files, so that they can build binaries targeting different versions of the toolset.
With the native Multi-targeting feature, once the “large C++ shops” migrated their applications to VS2010, they have the ability to use VS2010 to target any versions of the toolset theoretically. This eliminates the need to maintain multiple versions
of project files and the development work can be done all within VS2010, as long as the targeted toolsets are installed on the same machine.
How to enable native Multi-targeting?
The Multi-Targeting feature is available both when building from the IDE and building on the command line. Below is a screen shot of the native Multi-targeting settings on the property page: Platform Toolset controls which version of the toolsets you
want to target: v100 targets VS2010 and v90 targets the VS2008 level toolsets and libraries.
The Platform toolset version is v100 by default for both newly created projects and projects converted to VS2010. In both cases, the “PlatformToolset” property is not written to the project file. There are a couple of ways you can re-target to different
PlatformToolset (v90 is used as an example below):
For single project, you can choose your targeted platform toolset to be v90 in the property page, the “PlatformToolset” property will be written to your project file as the following:
<PropertyGroupCondition="'$(Configuration)|$(Platform)'=='Debug|Win32'"Label="Configuration">" _msthash="1688201"
_mstchunk="true">PropertyGroupCondition="'$(Configuration)|$(Platform)'=='Debug|Win32'"Label="Configuration">
<ConfigurationType>Application</ConfigurationType>" _msthash="1688202" _mstchunk="true">ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>" _msthash="1688203" _mstchunk="true">UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>" _msthash="1688204" _mstchunk="true">CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v90</PlatformToolset>" _msthash="1688205" _mstchunk="true">PlatformToolset>v90</PlatformToolset>
</PropertyGroup>
In order to re-target multiple projects at once, you can multi-select them in Solution Explorer and then bring up the Property Pages. To make the changes apply to all configurations, also select from the Configuration dropdown “All configurations”
entry and from Platform dropdown “All platforms” entry. Note that multi-select will work only if all projects are of the same type.
Once the “PlatformToolset” is set to v90, the compiler, linker, headers, and libraries from VS2008 will be used. Below is a snapshot of the build log when building against the v90 toolset from the VS2010 IDE or command line prompt. You can see that
VS2008 compiler is used instead of VS2010 compiler.
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _UNICODE /D UNICODE /D _AFXDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"StdAfx.h" /Fp"Debug\MFC.pch"
/Fo"Debug\\" /Fd"Debug\vc90.pdb" /Gd /TP /analyze- /errorReport:prompt stdafx.cpp
Note that changing the value of the Platform Toolset property will cause a full rebuild of the project.
How does it work?
In VS2010, there are V90 and V100 folders under %ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\<Platforms>\PlatformToolsets or %ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\<Platforms>\PlatformToolsets on a x64 machine. Inside each
folder, you can find a ToolSet specific props and targets file. Here is a representation of the layout of the file/directory structure on the disk:
Microsoft.Cpp.<Platform>.<PlatformToolset>.props file sets the properties required to build against a certain toolset. For example, in Microsoft.Cpp.Win32.v90.Props, ExecutablePath (PATH), IncludePath (INCLUDE), ReferencePath (LIBPATH), LibraryPath
(LIB), SourcePath, ExcludedPath are set based on the VS2008 installation and Windows SDK installation that shipped with VS2008 (6.0A)
<VCInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)</VCInstallDir>" _msthash="1688212"
_mstchunk="true">VCInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)</VCInstallDir>
<VCInstallDir
Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)</VCInstallDir>"
_msthash="1688214" _mstchunk="true">Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)</VCInstallDir>
<VCInstallDir
Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)</VCInstallDir>"
_msthash="1688216" _mstchunk="true">Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)</VCInstallDir>
<VCInstallDir
Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)</VCInstallDir>"
_msthash="1688218" _mstchunk="true">Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)</VCInstallDir>
<WindowsSdkDir
Condition="'$(UseEnv)' !='true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\Windows@CurrentInstallFolder)</WindowsSdkDir>" _msthash="1688220" _mstchunk="true">Condition="'$(UseEnv)'
!='true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder)</WindowsSdkDir>
<WindowsSdkDir
Condition="'$(WindowsSdkDir)'==''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MicrosoftSDKs\Windows@CurrentInstallFolder)</WindowsSdkDir>"
_msthash="1688222" _mstchunk="true">Condition="'$(WindowsSdkDir)'==''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MicrosoftSDKs\Windows@CurrentInstallFolder)</WindowsSdkDir>
<ExecutablePath
Condition="'$(ExecutablePath)' == ''">$(VCInstallDir)bin;$(WindowsSDKDir)bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML
Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>" _msthash="1688224" _mstchunk="true">Condition="'$(ExecutablePath)'
== ''">$(VCInstallDir)bin;$(WindowsSDKDir)bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML
Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
<IncludePath
Condition="'$(IncludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;</IncludePath>"
_msthash="1688226" _mstchunk="true">Condition="'$(IncludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;</IncludePath>
<ReferencePath
Condition="'$(ReferencePath)' == ''">$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib</ReferencePath>"
_msthash="1688228" _mstchunk="true">Condition="'$(ReferencePath)' == ''">$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib</ReferencePath>
<LibraryPath
Condition="'$(LibraryPath)' == ''">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)lib</LibraryPath>"
_msthash="1688230" _mstchunk="true">Condition="'$(LibraryPath)' == ''">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)lib</LibraryPath>
<SourcePath
Condition="'$(SourcePath)' == ''">$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\mfcm;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>"
_msthash="1688232" _mstchunk="true">Condition="'$(SourcePath)' == ''">$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\mfcm;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>
<ExcludePath
Condition="'$(ExcludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;</ExcludePath>"
_msthash="1688234" _mstchunk="true">Condition="'$(ExcludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;</ExcludePath>
MSBuild can spawn the build environment based on the information you set in the props file for a certain platform toolset. In the command line build scenarios, this means that the PATH, LIBPATH, LIB, INCLUDE that the build system is using can come
from the PlatformToolsets itself, which can eliminate the need to use other batch files, such as vcvars32.bat, to set up the build environment. This is a functionality that the old VCBuild system does not have. Below is a code snippet from Microsoft.cpp.Targets
that enables the functionality. When UseEnv is not set to true, PATH, LIB, INCLUDE, LIBPATH will be set from the corresponding property values in the platform toolset. When UseEnv is set to true, as in old build system, the values from environment variables
for PATH, INCLUDE, LIB, LIBPATH will be used, instead.
<TargetName="SetBuildDefaultEnvironmentVariables"" _msthash="1920036" _mstchunk="true">TargetName="SetBuildDefaultEnvironmentVariables"
Condition="'$(UseEnv)' != 'true'">" _msthash="1920037" _mstchunk="true">Condition="'$(UseEnv)'
!= 'true'">
<SetEnvCondition="'$(_IsNativeEnvironment)' != 'true'"" _msthash="1920038" _mstchunk="true">SetEnvCondition="'$(_IsNativeEnvironment)'
!= 'true'"
Name ="PATH"" _msthash="1920039" _mstchunk="true">Name ="PATH"
Value ="$(ExecutablePath)"" _msthash="1920040" _mstchunk="true">Value ="$(ExecutablePath)"
Prefix ="false">" _msthash="1920041" _mstchunk="true">Prefix ="false">
<OutputTaskParameter="OutputEnvironmentVariable"PropertyName="Path"/>" _msthash="1920042" _mstchunk="true">OutputTaskParameter="OutputEnvironmentVariable"PropertyName="Path"/>
</SetEnv>
<SetEnvCondition="'$(_IsNativeEnvironment)' == 'true'"" _msthash="1920044" _mstchunk="true">SetEnvCondition="'$(_IsNativeEnvironment)'
== 'true'"
Name ="PATH"" _msthash="1920045" _mstchunk="true">Name ="PATH"
Value ="$(NativeExecutablePath)"" _msthash="1920046" _mstchunk="true">Value ="$(NativeExecutablePath)"
Prefix ="false">" _msthash="1920047" _mstchunk="true">Prefix ="false">
<OutputTaskParameter="OutputEnvironmentVariable"PropertyName="Path"/>" _msthash="1920048" _mstchunk="true">OutputTaskParameter="OutputEnvironmentVariable"PropertyName="Path"/>
</SetEnv>
<SetEnvName ="LIB"" _msthash="1920050" _mstchunk="true">SetEnvName
="LIB"
Value ="$(LibraryPath)"" _msthash="1920051" _mstchunk="true">Value ="$(LibraryPath)"
Prefix ="false">" _msthash="1920052" _mstchunk="true">Prefix ="false">
<OutputTaskParameter="OutputEnvironmentVariable"PropertyName="LIB"/>" _msthash="1920053" _mstchunk="true">OutputTaskParameter="OutputEnvironmentVariable"PropertyName="LIB"/>
</SetEnv>
<SetEnvName ="LIBPATH"" _msthash="1920055" _mstchunk="true">SetEnvName
="LIBPATH"
Value ="$(ReferencePath)"" _msthash="1920056" _mstchunk="true">Value ="$(ReferencePath)"
Prefix ="false">" _msthash="1920057" _mstchunk="true">Prefix ="false">
<OutputTaskParameter="OutputEnvironmentVariable"PropertyName="LIBPATH"/>" _msthash="1920058" _mstchunk="true">OutputTaskParameter="OutputEnvironmentVariable"PropertyName="LIBPATH"/>
</SetEnv>
<SetEnvName ="INCLUDE"" _msthash="1920060" _mstchunk="true">SetEnvName
="INCLUDE"
Value ="$(IncludePath)"" _msthash="1920061" _mstchunk="true">Value ="$(IncludePath)"
Prefix ="false" >" _msthash="1920062" _mstchunk="true">Prefix ="false"
>
<OutputTaskParameter="OutputEnvironmentVariable"PropertyName="INCLUDE"/>" _msthash="1920063" _mstchunk="true">OutputTaskParameter="OutputEnvironmentVariable"PropertyName="INCLUDE"/>
</SetEnv>
</Target>
For managed applications, since the VS2008 compiler can only target CLR 2.0, targeting v90 platform toolset it allows only one of these versions of .NET Framework: v2.0, v3.0 or v3.5. By default, v90 platform toolset target v3.5 framework.
How to extend it?
With this model, if you have a specific SDK that you would like to target, you can create your custom platform toolset. Below is an example of a Microsoft.cpp.Win32.v80.props file for targeting VS2005. Note that for VS2005, WindowsSDKDir is not available,
we have PlatformSDK instead. After creating the v80 directory for each platform along with the corresponding props and targets files, you will have support to build against v80 instantly.
<Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003">" _msthash="1920068" _mstchunk="true">Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportProject="$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportBefore\*.props"Condition="Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v80\ImportBefore')"
/>" _msthash="1920069" _mstchunk="true">ImportProject="$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportBefore\*.props"Condition="Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v80\ImportBefore')"
/>
<PropertyGroup>
<PlatformToolsetVersion>80</PlatformToolsetVersion>" _msthash="1920071" _mstchunk="true">PlatformToolsetVersion>80</PlatformToolsetVersion>
<VCInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)</VCInstallDir>" _msthash="1920072"
_mstchunk="true">VCInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)</VCInstallDir>
<VCInstallDir
Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)</VCInstallDir>"
_msthash="1920074" _mstchunk="true">Condition="'$(VCInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)</VCInstallDir>
<VSInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)</VSInstallDir>"
_msthash="1920075" _mstchunk="true">VSInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)</VSInstallDir>
<VSInstallDir
Condition="'$(VSInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)</VSInstallDir>"
_msthash="1920077" _mstchunk="true">Condition="'$(VSInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)</VSInstallDir>
<FrameworkDir
Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)</FrameworkDir>"
_msthash="1920079" _mstchunk="true">Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)</FrameworkDir>
<FrameworkDir
Condition="'$(FrameworkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)</FrameworkDir>"
_msthash="1920081" _mstchunk="true">Condition="'$(FrameworkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)</FrameworkDir>
<FrameworkSdkDir
Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>"
_msthash="1920083" _mstchunk="true">Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>
<FrameworkSdkDir
Condition="'$(FrameworkSdkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>"
_msthash="1920085" _mstchunk="true">Condition="'$(FrameworkSdkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>
<FrameworkSdkDir
Condition="'$(FrameworkSdkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>"
_msthash="1920087" _mstchunk="true">Condition="'$(FrameworkSdkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft
SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>
<FrameworkVersion
Condition="'$(UseEnv)' != 'true'">v2.0.50727</FrameworkVersion>" _msthash="1920089" _mstchunk="true">Condition="'$(UseEnv)'
!= 'true'">v2.0.50727</FrameworkVersion>
<Framework35Version
Condition="'$(UseEnv)' != 'true'">v3.5</Framework35Version>" _msthash="1920091" _mstchunk="true">Condition="'$(UseEnv)'
!= 'true'">v3.5</Framework35Version>
<ExecutablePath
Condition="'$(ExecutablePath)' == ''">$(VCInstallDir)bin;$(VCInstallDir)PlatformSDK\bin;$(VCInstallDir)PlatformSDK\common\bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML
Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>" _msthash="1920093" _mstchunk="true">Condition="'$(ExecutablePath)'
== ''">$(VCInstallDir)bin;$(VCInstallDir)PlatformSDK\bin;$(VCInstallDir)PlatformSDK\common\bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
<IncludePath
Condition="'$(IncludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;</IncludePath>"
_msthash="1920095" _mstchunk="true">Condition="'$(IncludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;</IncludePath>
<ReferencePath
Condition="'$(ReferencePath)' == ''">$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;</ReferencePath>"
_msthash="1920097" _mstchunk="true">Condition="'$(ReferencePath)' == ''">$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;</ReferencePath>
<LibraryPath
Condition="'$(LibraryPath)' == ''">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)atlmfc\lib\i386;$(VCInstallDir)PlatformSDK\lib;$(VCInstallDir)PlatformSDK\common\lib;$(FrameworkSDKDir)lib;$(VSInstallDir);$(VSInstallDir)lib;</LibraryPath>"
_msthash="1920099" _mstchunk="true">Condition="'$(LibraryPath)' == ''">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)atlmfc\lib\i386;$(VCInstallDir)PlatformSDK\lib;$(VCInstallDir)PlatformSDK\common\lib;$(FrameworkSDKDir)lib;$(VSInstallDir);$(VSInstallDir)lib;</LibraryPath>
<SourcePath
Condition="'$(SourcePath)' == ''">$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>"
_msthash="1920101" _mstchunk="true">Condition="'$(SourcePath)' == ''">$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>
<ExcludePath
Condition="'$(ExcludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;</ExcludePath>"
_msthash="1920103" _mstchunk="true">Condition="'$(ExcludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;</ExcludePath>
<NativeExecutablePath
Condition="'$(NativeExecutablePath)' == ''">$(ExecutablePath)</NativeExecutablePath>" _msthash="1920105"
_mstchunk="true">Condition="'$(NativeExecutablePath)' == ''">$(ExecutablePath)</NativeExecutablePath>
</PropertyGroup>
<ImportProject="$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportAfter\*..props"Condition="Exists('$(VCTargetsPath)\Platforms\Win32\
PlatformToolsets\v80\ImportAfter')" />" _msthash="1920107" _mstchunk="true">ImportProject="$(VCTargetsPath)\Platforms\Win32\
PlatformToolsets\v80\ImportAfter\*..props"Condition="Exists('$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportAfter')"
/>
</Project>
Below is a snapshot of the IDE build setting and the build log:
The Platform Toolset feature also provides the extensibility points. In the Microsoft.Cpp.Win32.<PlatformToolset version>.props file, there are the following sections:
<ImportProject="$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore\*.props"" _msthash="1920111" _mstchunk="true">ImportProject="$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore\*.props"
Condition="Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore')" />" _msthash="1920112" _mstchunk="true">Condition="Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore')"
/>
<ImportProject="$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter\*.props"" _msthash="1920113" _mstchunk="true">ImportProject="$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter\*.props"
Condition="Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter')" />" _msthash="1920114" _mstchunk="true">Condition="Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter')"
/>
With this design, you can create your own special props file that is specific to a certain Platform Toolset. For example, you might create a custom props file called DirectX.props (it could be called anything) which you then drop into the following
folder: win32\PlatformToolsets\v100\ImportAfter. The Properties defined in DirectX.props (below) would beimported after the properties in Microsoft.Cpp.Win32.<PlatformToolset version>.props are imported.
<Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003">" _msthash="1920116" _mstchunk="true">Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(DirectXSDK)\Latest\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>" _msthash="1920119"
_mstchunk="true">AdditionalIncludeDirectories>$(DirectXSDK)\Latest\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(DirectXSDK)\Latest\Lib\x86%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>" _msthash="1920122"
_mstchunk="true">AdditionalLibraryDirectories>$(DirectXSDK)\Latest\Lib\x86%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
</Project>
Upon compile, you will get /I d:\DirectX\Latest\include being passed to CL.exe and /LIBPATH:d:\DirectX\Latest\Lib\x86 being passed to the linker when compiling a project targeting the Win32 platform and the v100 platform toolset. Any other project
configurations will not be impacted.
Windows SDK will adopt this Platform Toolset concept for future releases so that re-targeting of different WinSDK versions becomes an easier task. We also encourage
our customers to use this feature and let us know if you have any feedback.
In the example of the vc8 PlatformToolset above, you need to change <ExecutablePath> in Microsoft.Cpp.<Platform>.<PlatformToolset>.props to point to VS2010 compiler/linker path. For Example,
<ExecutablePath
Condition="'$(ExecutablePath)' == ''">$(VC10InstallDir)bin;$(WindowsSDKDir)bin;$(VS10InstallDir)Common7\Tools\bin;$(VS10InstallDir)Common7\tools;$(VS10InstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VS10InstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
You need to define VC10InstallDir, VS10InstallDir.
Li Shao
Project and Build Team |
|