Skip to content

Commit

Permalink
Fea #64, 基于msvcr14为MD/MDd提供一致性的体验
Browse files Browse the repository at this point in the history
  • Loading branch information
mingkuang-Chuyu committed Jan 14, 2025
1 parent 3ab7387 commit e8d53da
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 161 deletions.
32 changes: 10 additions & 22 deletions .github/workflows/Build&Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:
# Procdump工具,用于单元测试崩溃诊断
Invoke-WebRequest -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile Tools\Procdump.zip
&7z e Tools\Procdump.zip "-o$Env:GITHUB_WORKSPACE\Tools"
Invoke-WebRequest -Uri https://github.com/Chuyu-Team/msvcr14x/releases/latest/download/VC-LTL.Redist.Dlls.zip -OutFile VC-LTL.Redist.Dlls.zip
Invoke-WebRequest -Uri https://github.com/Chuyu-Team/msvcr14x/releases/latest/download/VC-LTL.Redist.PDBs.zip -OutFile VC-LTL.Redist.PDBs.zip
$ProgramFiles = ${env:ProgramFiles(x86)}
Expand Down Expand Up @@ -86,6 +88,9 @@ jobs:
$BuildVersion = $env:GITHUB_REF.Remove(0, 11);
echo "BuildVersion=$BuildVersion" >> $env:GITHUB_ENV
$Prerelease = $BuildVersion.contains("-");
echo "Prerelease=$Prerelease" >> $env:GITHUB_ENV
# github的内置版本有Bug,此行必须添加,否则无法获得内容
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
Expand Down Expand Up @@ -172,11 +177,6 @@ jobs:
::生成二进制包
msbuild Build.proj -p:TagVersion=${{env.BuildVersion}} -t:Pack
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
:: 打包Redist
if "${{env.BuildVersion}}" NEQ "" (
msbuild Build.proj -p:TagVersion=${{env.BuildVersion}} -t:PackRedist
)
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
Expand All @@ -188,26 +188,12 @@ jobs:
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
- name: 匹配Redist缓存
if: contains(github.ref, 'tags/')
id: ltlRedistCache
uses: actions/cache@v4
with:
path: VC-LTL*-Redist.7z
key: ltl_Redist_${{ hashFiles('Redist/**/*.dll') }}

- name: 文件清理
if: steps.ltlRedistCache.outputs.cache-hit == 'true'
working-directory: ${{github.workspace}}
shell: cmd
run: |
del VC-LTL-${{env.BuildVersion}}-Redist.7z /Q /F
- uses: actions/upload-artifact@v4
with:
path: |
*.nupkg
*.7z
VC-LTL.Redist.*.zip
# 失败时我们收集一些信息,用于诊断
- uses: actions/upload-artifact@v4
Expand All @@ -222,16 +208,18 @@ jobs:
Static\*.log
UnitTest/SymbolBuildTest/.test/**/Build.log
*.7z
VC-LTL.Redist.*.zip
- uses: xresloader/upload-to-github-release@v1
if: contains(github.ref, 'tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "VC-LTL-*.7z"
file: "VC-LTL-*.7z;VC-LTL.Redist.*.zip"
overwrite: true
tags: true
draft: false
prerelease: ${{env.Prerelease}}

- uses: actions-rs/toolchain@v1
with:
Expand Down
106 changes: 5 additions & 101 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<Import Project="$(VCInstallDir)\Auxiliary\Build\Microsoft.VCToolsVersion.default.props" />

<Target Name="DownloadTools" BeforeTargets="Build;PackRedist">
<Target Name="DownloadTools" BeforeTargets="Build">
<!--下载LibMaker-->
<DownloadFile
Condition="!Exists('$(MSBuildThisFileDirectory)Tools\LibMaker.exe')"
Expand Down Expand Up @@ -70,15 +70,15 @@
<MSBuild Projects="@(WindowsTargetPlatformMinVersionItem)" StopOnFirstFailure="True" Targets="Build_libucrt_shared" BuildInParallel="True" Properties="$(GlobalProperties)"/>

<!--启动实际编译-->
<MSBuild Projects="@(ProjectReference)" StopOnFirstFailure="True" BuildInParallel="True" Properties="$(GlobalProperties)"/>
<MSBuild Projects="@(ProjectReference)" StopOnFirstFailure="True" BuildInParallel="True" Properties="$(GlobalProperties)"/>
</Target>

<!-- VC-LTL Rust crate 编译准备 -->
<Target Name="PrepareToCompileRustLanguageSupport">
<ItemGroup>
<RustTargetPlatform_x86 Include="$(SolutionDir)TargetPlatform\6.0.6000.0\lib\Win32\*ucrt.lib;$(SolutionDir)TargetPlatform\6.0.6000.0\lib\Win32\*vcruntime.lib;" />
<RustTargetPlatform_x64 Include="$(SolutionDir)TargetPlatform\6.0.6000.0\lib\x64\*ucrt.lib;$(SolutionDir)TargetPlatform\6.0.6000.0\lib\x64\*vcruntime.lib;" />
<RustTargetPlatform_arm64 Include="$(SolutionDir)TargetPlatform\10.0.10240.0\lib\ARM64\*ucrt.lib;$(SolutionDir)TargetPlatform\10.0.10240.0\lib\ARM64\*vcruntime.lib;" />
<RustTargetPlatform_x86 Include="$(SolutionDir)TargetPlatform\6.0.6000.0\lib\Win32\**\*ucrt.lib;$(SolutionDir)TargetPlatform\6.0.6000.0\lib\Win32\**\*vcruntime.lib;" />
<RustTargetPlatform_x64 Include="$(SolutionDir)TargetPlatform\6.0.6000.0\lib\x64\**\*ucrt.lib;$(SolutionDir)TargetPlatform\6.0.6000.0\lib\x64\**\*vcruntime.lib;" />
<RustTargetPlatform_arm64 Include="$(SolutionDir)TargetPlatform\10.0.10240.0\lib\ARM64\**\*ucrt.lib;$(SolutionDir)TargetPlatform\10.0.10240.0\lib\ARM64\**\*vcruntime.lib;" />
<RustTargetPlatform_Common Include="$(SolutionDir)Readme.md;$(SolutionDir)LICENSE;" />
</ItemGroup>

Expand All @@ -96,102 +96,6 @@
<Delete Files="$(MSBuildThisFileDirectory)$(ZipFileName)"/>
<Exec Command="7z.exe a $(ZipFileName) config _msvcrt.h %22VC-LTL helper for *%22 TargetPlatform Readme.md Readme.osc.md Install.cmd -xr!*.objs.lib -xr!*.idb" WorkingDirectory="$(MSBuildThisFileDirectory)"/>
</Target>

<Target Name="PackRedist">
<PropertyGroup>
<ZipFileName Condition="'$(TagVersion)' == ''">VC-LTL-Redist.7z</ZipFileName>
<ZipFileName Condition="'$(TagVersion)' != ''">VC-LTL-$(TagVersion)-Redist.7z</ZipFileName>
</PropertyGroup>

<!--生成Redist相关文件-->
<PropertyGroup>
<ExcludeCRT2>**\vccorlib140.dll;**\vcruntime140.dll</ExcludeCRT2>
</PropertyGroup>
<!--生成移除了API Set的CRT DLL-->
<RemoveDir Directories="$(SolutionDir)Redist" Condition="Exists('$(SolutionDir)Redist')"/>
<MakeDir Directories="$(SolutionDir)Redist" />

<Copy SourceFiles="$(UniversalCRTSdkDir)Redist\$(WindowsTargetPlatformVersion)\ucrt\DLLs\x86\ucrtbase.dll" DestinationFiles="$(SolutionDir)Redist\x86\CRT\ucrtbase.dll" />
<Copy SourceFiles="$(UniversalCRTSdkDir)Redist\$(WindowsTargetPlatformVersion)\ucrt\DLLs\x64\ucrtbase.dll" DestinationFiles="$(SolutionDir)Redist\x64\CRT\ucrtbase.dll" />
<!--<Copy SourceFiles="$(UniversalCRTSdkDir)Redist\$(WindowsTargetPlatformVersion)\ucrt\DLLs\arm\ucrtbase.dll" DestinationFiles="$(SolutionDir)Redist\arm\CRT\ucrtbase.dll" Condition="Exists('$(UniversalCRTSdkDir)Redist\$(WindowsTargetPlatformVersion)\ucrt\DLLs\arm\ucrtbase.dll')"/>-->
<Copy SourceFiles="$(UniversalCRTSdkDir)Redist\$(WindowsTargetPlatformVersion)\ucrt\DLLs\arm64\ucrtbase.dll" DestinationFiles="$(SolutionDir)Redist\arm64\CRT\ucrtbase.dll" Condition="Exists('$(UniversalCRTSdkDir)Redist\$(WindowsTargetPlatformVersion)\ucrt\DLLs\arm64\ucrtbase.dll')"/>

<ItemGroup>
<CRTExcludeList Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\*\Microsoft.VC*.CRT\vcruntime*.dll"/>
<CRTExcludeList Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\*\Microsoft.VC*.CRT\vccorlib*.dll"/>

<CRTx86 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x86\Microsoft.VC*.CRT\*.dll" Exclude="@(CRTExcludeList)"/>
<CRTx64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x64\Microsoft.VC*.CRT\*.dll" Exclude="@(CRTExcludeList)"/>
<CRTarm Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm\Microsoft.VC*.CRT\*.dll" Exclude="@(CRTExcludeList)"/>
<CRTarm64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm64\Microsoft.VC*.CRT\*.dll" Exclude="@(CRTExcludeList)"/>
</ItemGroup>

<Copy SourceFiles="@(CRTx86)" DestinationFolder="$(SolutionDir)Redist\x86\CRT"/>
<Copy SourceFiles="@(CRTx64)" DestinationFolder="$(SolutionDir)Redist\x64\CRT"/>
<!--<Copy SourceFiles="@(CRTarm)" DestinationFolder="$(SolutionDir)Redist\arm\CRT"/>-->
<Copy SourceFiles="@(CRTarm64)" DestinationFolder="$(SolutionDir)Redist\arm64\CRT"/>

<ItemGroup>
<CXXAMPx86 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x86\Microsoft.VC*.CXXAMP\*.dll" />
<CXXAMPx64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x64\Microsoft.VC*.CXXAMP\*.dll" />
<CXXAMParm Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm\Microsoft.VC*.CXXAMP\*.dll" />
<CXXAMParm64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm64\Microsoft.VC*.CXXAMP\*.dll" />
</ItemGroup>

<Copy SourceFiles="@(CXXAMPx86)" DestinationFolder="$(SolutionDir)Redist\x86\CXXAMP" />
<Copy SourceFiles="@(CXXAMPx64)" DestinationFolder="$(SolutionDir)Redist\x64\CXXAMP" />
<!--<Copy SourceFiles="@(CXXAMParm)" DestinationFolder="$(SolutionDir)Redist\arm\CXXAMP" />-->
<Copy SourceFiles="@(CXXAMParm64)" DestinationFolder="$(SolutionDir)Redist\arm64\CXXAMP" />


<ItemGroup>
<OPENMPx86 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x86\Microsoft.VC*.OPENMP\*.dll" />
<OPENMPx64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x64\Microsoft.VC*.OPENMP\*.dll" />
<OPENMParm Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm\Microsoft.VC*.OPENMP\*.dll" />
<OPENMParm64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm64\Microsoft.VC*.OPENMP\*.dll" />
</ItemGroup>

<Copy SourceFiles="@(OPENMPx86)" DestinationFolder="$(SolutionDir)Redist\x86\OPENMP" />
<Copy SourceFiles="@(OPENMPx64)" DestinationFolder="$(SolutionDir)Redist\x64\OPENMP" />
<!--<Copy SourceFiles="@(OPENMParm)" DestinationFolder="$(SolutionDir)Redist\arm\OPENMP" />-->
<Copy SourceFiles="@(OPENMParm64)" DestinationFolder="$(SolutionDir)Redist\arm64\OPENMP" />


<ItemGroup>
<MFCx86 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x86\Microsoft.VC*.MFC\*.dll" />
<MFCx64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x64\Microsoft.VC*.MFC\*.dll" />
<MFCarm Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm\Microsoft.VC*.MFC\*.dll" />
<MFCarm64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm64\Microsoft.VC*.MFC\*.dll" />
</ItemGroup>

<Copy SourceFiles="@(MFCx86)" DestinationFolder="$(SolutionDir)Redist\x86\MFC" />
<Copy SourceFiles="@(MFCx64)" DestinationFolder="$(SolutionDir)Redist\x64\MFC" />
<!--<Copy SourceFiles="@(MFCarm)" DestinationFolder="$(SolutionDir)Redist\arm\MFC" />-->
<Copy SourceFiles="@(MFCarm64)" DestinationFolder="$(SolutionDir)Redist\arm64\MFC" />

<ItemGroup>
<MFCLOCx86 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x86\Microsoft.VC*.MFCLOC\*.dll" />
<MFCLOCx64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\x64\Microsoft.VC*.MFCLOC\*.dll" />
<MFCLOCarm Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm\Microsoft.VC*.MFCLOC\*.dll" />
<MFCLOCarm64 Include="$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\arm64\Microsoft.VC*.MFCLOC\*.dll" />
</ItemGroup>

<Copy SourceFiles="@(MFCLOCx86)" DestinationFolder="$(SolutionDir)Redist\x86\MFCLOC" />
<Copy SourceFiles="@(MFCLOCx64)" DestinationFolder="$(SolutionDir)Redist\x64\MFCLOC" />
<!--<Copy SourceFiles="@(MFCLOCarm)" DestinationFolder="$(SolutionDir)Redist\arm\MFCLOC" />-->
<Copy SourceFiles="@(MFCLOCarm64)" DestinationFolder="$(SolutionDir)Redist\arm64\MFCLOC" />


<!--移除APISet-->
<ItemGroup>
<RedistFiles Include="$(SolutionDir)Redist\**\*.dll"/>
</ItemGroup>
<Exec Command="%22$(MSBuildThisFileDirectory)Tools\LibMaker.exe%22 RemoveAPISet %22%(RedistFiles.identity)%22 %22$(MSBuildThisFileDirectory)Tools\ApiSetMap.txt%22" WorkingDirectory="$(MSBuildThisFileDirectory)"/>


<Delete Files="$(MSBuildThisFileDirectory)$(ZipFileName)"/>
<Exec Command="7z.exe a $(ZipFileName) Redist" WorkingDirectory="$(MSBuildThisFileDirectory)"/>
</Target>

<Target Name="_GetProjectAllConfiguration" Returns="@(AllProjectReferenceConfigurations)">
<!--故意过滤Debug配置 与 ARM配置,因为ARM的人实在是太少了。-->
Expand Down
3 changes: 3 additions & 0 deletions VC-LTL helper for Visual Studio.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ VC-LTL默认搜索顺序
<PropertyGroup>
<!--控制TargetPlatform版本,目前可用版本为 5.1.2600.0 6.0.6000.0(默认) 6.2.9200.0 10.0.10240.0 10.0.19041.0-->
<!--<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>-->

<!--实验性功能!开启后,对于使用`/MD`构建项目将依赖ucrtbase.dll,使用后你可能需要下载VC-LTL.Redist.Dlls.zip(感谢msvcr14x项目提供兼容XP系统的ucrtbase.dll)。-->
<!--<VC_LTL_EnableNewStyleRuntimeDlls>true</VC_LTL_EnableNewStyleRuntimeDlls>-->
</PropertyGroup>
<!--####################################################################################################################################################-->

Expand Down
3 changes: 3 additions & 0 deletions VC-LTL helper for cmake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

#(PR#70 引入),默认关,开启后将使用cmake `INTERFACE`能力,然后单独`target_link_directories(工程名称 VC_LTL)` 即可引用
#option(VC_LTL_EnableCMakeInterface "VC_LTL_EnableCMakeInterface" on)

#(Fea #64 引入),实验性功能!开启后,对于使用`/MD`构建项目将依赖ucrtbase.dll,使用后你可能需要下载VC-LTL.Redist.Dlls.zip(感谢msvcr14x项目提供兼容XP系统的ucrtbase.dll)。
#option(VC_LTL_EnableNewStyleRuntimeDlls "VC_LTL_EnableNewStyleRuntimeDlls" on)
####################################################################################################################################################

if(NOT VC_LTL_Root)
Expand Down
3 changes: 3 additions & 0 deletions VC-LTL helper for nmake.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
::控制TargetPlatform版本,目前可用版本为 5.1.2600.0 6.0.6000.0(默认) 6.2.9200.0 10.0.10240.0 10.0.19041.0
::set WindowsTargetPlatformMinVersion=10.0.10240.0

::(Fea #64 引入),实验性功能!开启后,对于使用`/MD`构建项目将依赖ucrtbase.dll,使用后你可能需要下载VC-LTL.Redist.Dlls.zip(感谢msvcr14x项目提供兼容XP系统的ucrtbase.dll)。
::set VC_LTL_EnableNewStyleRuntimeDlls=true

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Expand Down
2 changes: 2 additions & 0 deletions VC-LTL helper for nmake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
# 控制TargetPlatform版本,目前可用版本为 5.1.2600.0 6.0.6000.0(默认) 6.2.9200.0 10.0.10240.0 10.0.19041.0
# $env:WindowsTargetPlatformMinVersion="10.0.10240.0"

# (Fea #64 引入),实验性功能!开启后,对于使用`/MD`构建项目将依赖ucrtbase.dll,使用后你可能需要下载VC-LTL.Redist.Dlls.zip(感谢msvcr14x项目提供兼容XP系统的ucrtbase.dll)。
# $env:VC_LTL_EnableNewStyleRuntimeDlls="true"
################################################################################################################################

do
Expand Down
3 changes: 3 additions & 0 deletions VC-LTL helper for qmake.pri
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
# 控制TargetPlatform版本,目前可用版本为 6.0.6000.0(默认) 6.2.9200.0 10.0.10240.0 10.0.19041.0
# WindowsTargetPlatformMinVersion = 10.0.10240.0

# (Fea #64 引入),实验性功能!开启后,对于使用`/MD`构建项目将依赖ucrtbase.dll,使用后你可能需要下载VC-LTL.Redist.Dlls.zip(感谢msvcr14x项目提供兼容XP系统的ucrtbase.dll)。
# VC_LTL_EnableNewStyleRuntimeDlls = true

# -----------------------------------------------------------------------------------------------------------------------------------------------------


Expand Down
8 changes: 7 additions & 1 deletion config/1033/VC-LTL-Options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@
Category="VC_LTL"
DisplayName="Enable VC-LTL"
Description="Allow the current project to enable VC-LTL."/>


<BoolProperty
Name="VC_LTL_EnableNewStyleRuntimeDlls"
Category="VC_LTL"
DisplayName="开启新式Dlls依赖"
Description="实验性功能!开启后,对于使用`/MD`构建项目将依赖ucrtbase.dll,使用后你可能需要下载VC-LTL.Redist.Dlls.zip(感谢msvcr14x项目提供兼容XP系统的ucrtbase.dll)。"/>

<EnumProperty
Name="WindowsTargetPlatformMinVersion"
Category="VC_LTL"
Expand Down
8 changes: 7 additions & 1 deletion config/2052/VC-LTL-Options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@
Category="VC_LTL"
DisplayName="启用VC-LTL"
Description="允许当前项目启用VC-LTL,此选项一般用于验证某些问题时使用,非特殊情况建议始终保持开启。"/>


<BoolProperty
Name="VC_LTL_EnableNewStyleRuntimeDlls"
Category="VC_LTL"
DisplayName="开启新式Dlls依赖"
Description="实验性功能!开启后,对于使用`/MD`构建项目将依赖ucrtbase.dll,使用后你可能需要下载VC-LTL.Redist.Dlls.zip(感谢msvcr14x项目提供兼容XP系统的ucrtbase.dll)。"/>

<EnumProperty
Name="WindowsTargetPlatformMinVersion"
Category="VC_LTL"
Expand Down
9 changes: 8 additions & 1 deletion config/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,15 @@ if(${SupportLTL} STREQUAL "true")
message(" Platform :" ${LTLPlatform})
message("")

set(VC_LTL_MD_SharedVersion ${LTLWindowsTargetPlatformMinVersion})
if(VC_LTL_EnableNewStyleRuntimeDlls)
if(${LTLWindowsTargetPlatformMinVersion} VERSION_LESS 10.0.10240.0)
set(VC_LTL_MD_SharedVersion "10.0.10240.0")
endif()
endif()

set(VC_LTL_Include ${VC_LTL_Root}/TargetPlatform/header;${VC_LTL_Root}/TargetPlatform/${LTLWindowsTargetPlatformMinVersion}/header)
set(VC_LTL_Library ${VC_LTL_Root}/TargetPlatform/${LTLWindowsTargetPlatformMinVersion}/lib/${LTLPlatform})
set(VC_LTL_Library ${VC_LTL_Root}/TargetPlatform/${LTLWindowsTargetPlatformMinVersion}/lib/${LTLPlatform};${VC_LTL_Root}/TargetPlatform/${VC_LTL_MD_SharedVersion}/lib/${LTLPlatform}/Shared)

#message("INCLUDE " $ENV{INCLUDE})
#message("LIB " $ENV{LIB})
Expand Down
5 changes: 3 additions & 2 deletions config/config.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ echo VC Tools Version : %VCToolsVersion%
echo WindowsTargetPlatformMinVersion : %LTLWindowsTargetPlatformMinVersion%
echo Platform : %LTLPlatform%


set VC_LTL_MD_SharedVersion=%LTLWindowsTargetPlatformMinVersion%
if /i "%VC_LTL_EnableNewStyleRuntimeDlls%" == "true" (set VC_LTL_MD_SharedVersion=10.0.10240.0)

::修改Include
set INCLUDE=%VC_LTL_Root%TargetPlatform\header;%VC_LTL_Root%TargetPlatform\%LTLWindowsTargetPlatformMinVersion%\header;%INCLUDE%
set LIB=%VC_LTL_Root%TargetPlatform\%LTLWindowsTargetPlatformMinVersion%\lib\%LTLPlatform%;%LIB%
set LIB=%VC_LTL_Root%TargetPlatform\%LTLWindowsTargetPlatformMinVersion%\lib\%LTLPlatform%;%VC_LTL_Root%TargetPlatform\%VC_LTL_MD_SharedVersion%\lib\%LTLPlatform%\Shared;%LIB%

goto:eof

Expand Down
7 changes: 6 additions & 1 deletion config/config.pri
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ $$escape_expand(\\n)############################################################

message($$VC_LTL_Info)

VC_LTL_MD_SharedVersion = $$LTLWindowsTargetPlatformMinVersion
equals(VC_LTL_EnableNewStyleRuntimeDlls, true) {
VC_LTL_MD_SharedVersion = 10.0.10240.0
}

# 修改头文件及库搜索路径
QMAKE_INCDIR += \
$$VC_LTL_Root/TargetPlatform/header \
$$VC_LTL_Root/TargetPlatform/$$LTLWindowsTargetPlatformMinVersion/header

QMAKE_LIBS += \
-L$$VC_LTL_Root/TargetPlatform/$$LTLWindowsTargetPlatformMinVersion/lib/$$LTLPlatform
-L$$VC_LTL_Root/TargetPlatform/$$LTLWindowsTargetPlatformMinVersion/lib/$$LTLPlatform \
-L$$VC_LTL_Root/TargetPlatform/$$VC_LTL_MD_SharedVersion/lib/$$LTLPlatform/Shared
Loading

0 comments on commit e8d53da

Please sign in to comment.