Skip to content

Commit

Permalink
增加 WindowsTargetPlatformMinVersion选项
Browse files Browse the repository at this point in the history
  • Loading branch information
mingkuang-Chuyu committed Aug 15, 2021
1 parent abc3cf7 commit b31c139
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
23 changes: 23 additions & 0 deletions config/1033/VC-LTL-Options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,28 @@
Category="VC_LTL"
DisplayName="Enable VC-LTL"
Description="Allow the current project to enable VC-LTL."/>

<EnumProperty
Name="WindowsTargetPlatformMinVersion"
Category="VC_LTL"
DisplayName="Target CRT version"
Description="Select the link target, optimized to msvcrt 6.0.6000.0 by default.">
<EnumValue
Name="6.0.6000.0"
DisplayName="msvcrt 6.0.6000.0 (support Windows Vista/2008 or leater)"/>

<EnumValue
Name="6.2.9600.0"
DisplayName="msvcrt 6.2.9600.0 (support Windows 8/RT/2012 or leater)"/>

<EnumValue
Name="10.0.10240.0"
DisplayName="UCRT 10.0.10240.0 (support Windows XP or leater)"/>

<EnumValue
Name="10.0.19041.0"
DisplayName="UCRT 10.0.19041.0 (support Windows 10 19041 or leater)"/>
</EnumProperty>

</Rule>
</ProjectSchemaDefinitions>
22 changes: 22 additions & 0 deletions config/2052/VC-LTL-Options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,27 @@
Category="VC_LTL"
DisplayName="启用VC-LTL"
Description="允许当前项目启用VC-LTL,此选项一般用于验证某些问题时使用,非特殊情况建议始终保持开启。"/>

<EnumProperty
Name="WindowsTargetPlatformMinVersion"
Category="VC_LTL"
DisplayName="目标CRT版本"
Description="选择合适的链接目标,默认优化到msvcrt 6.0.6000.0。">
<EnumValue
Name="6.0.6000.0"
DisplayName="msvcrt 6.0.6000.0(支持Windows Vista/2008以及更高版本)"/>

<EnumValue
Name="6.2.9600.0"
DisplayName="msvcrt 6.2.9600.0(支持Windows 8/RT/2012以及更高版本)"/>

<EnumValue
Name="10.0.10240.0"
DisplayName="UCRT 10.0.10240.0(支持Windows XP以及更高版本)"/>

<EnumValue
Name="10.0.19041.0"
DisplayName="UCRT 10.0.19041.0(支持Windows 10 19041以及更高版本)"/>
</EnumProperty>
</Rule>
</ProjectSchemaDefinitions>
20 changes: 15 additions & 5 deletions config/config.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
作者:mingkuang
修改日期:2020-08-08
修改日期:2020-08-15
全新的VC-LTL 5.0 配置
Expand All @@ -30,11 +30,21 @@
<VCLTLTargetUniversalCRTVersion>10.0.19041.0</VCLTLTargetUniversalCRTVersion>
</PropertyGroup>
</When>
<Otherwise>
<!--其他情况,统一为10240-->
<When Condition="'$(PlatformShortName)'=='arm64' or '$(VCLTLTargetUniversalCRTBuildVersion)' >= '10240'">
<PropertyGroup>
<VCLTLTargetUniversalCRTVersion>10.0.10240.0</VCLTLTargetUniversalCRTVersion>
</PropertyGroup>
</When>
<When Condition="'$(PlatformShortName)'=='arm'">
<PropertyGroup>
<VCLTLTargetUniversalCRTVersion>6.2.9600.0</VCLTLTargetUniversalCRTVersion>
</PropertyGroup>
</When>
<Otherwise>
<!--其他情况,统一为6.0.6000.0-->
<PropertyGroup>
<VCLTLTargetUniversalCRTVersion>6.0.6000.0</VCLTLTargetUniversalCRTVersion>
</PropertyGroup>
</Otherwise>
</Choose>

Expand Down Expand Up @@ -85,7 +95,7 @@
<VCLTLPlatformName Condition=" '$(SupportWinXP)'=='true' ">WinXP</VCLTLPlatformName>
<VCLTLPlatformName Condition=" '$(SupportWinXP)'!='true' ">Vista</VCLTLPlatformName>

<VC_LTL_Library>$(MSBuildThisFileDirectory)..\ucrt\$(VCLTLTargetUniversalCRTVersion)\lib\$(Platform)</VC_LTL_Library>
<VC_LTL_Library>$(MSBuildThisFileDirectory)..\TargetPlatform\$(VCLTLTargetUniversalCRTVersion)\lib\$(Platform)</VC_LTL_Library>
</PropertyGroup>

<PropertyGroup Condition=" '$(SupportLTL)'=='true' or '$(SupportLTL)'=='ucrt'">
Expand All @@ -96,7 +106,7 @@

<ItemDefinitionGroup Condition=" '$(SupportLTL)'=='ucrt' or '$(SupportLTL)'=='true'">
<ClCompile>
<PreprocessorDefinitions>_ACRTIMP=__declspec(dllimport);_DCRTIMP=__declspec(dllimport);_Build_By_LTL=1;_LTL_Core_Version=$(LTL_CoreVersion);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_Build_By_LTL=1;_LTL_Core_Version=$(LTL_CoreVersion);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(SupportWinXP)'=='true'">_ATL_XP_TARGETING=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!--当兼容XP时,对于非 exe 的需要禁用线程安全初始化。避免XP中在DllMain中使用TLS而崩溃-->
<AdditionalOptions Condition="'$(SupportWinXP)'=='true' and '$(ConfigurationType)'!='Application' ">/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
Expand Down

0 comments on commit b31c139

Please sign in to comment.