mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-05 06:29:07 +08:00
92c0a91d3f
On Win7, calling powershell via MSBuild results in normal output lines being split based on the ConHost system-wide default line length settings. The fix is to first write all the lines to a file, then load that file as into an MSBuild ItemGroup. This avoids all interaction with ConHost.
83 lines
5.3 KiB
XML
83 lines
5.3 KiB
XML
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'Win32||'">
|
|
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
|
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-windows</VcpkgTriplet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'Win32|Windows Store|10.0'">
|
|
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
|
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-uwp</VcpkgTriplet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == '||'">
|
|
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
|
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-windows</VcpkgTriplet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == '|Windows Store|10.0'">
|
|
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
|
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-uwp</VcpkgTriplet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'x64||'">
|
|
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
|
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-windows</VcpkgTriplet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'x64|Windows Store|10.0'">
|
|
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
|
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-uwp</VcpkgTriplet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'arm|Windows Store|10.0'">
|
|
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
|
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">arm-uwp</VcpkgTriplet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'">
|
|
<VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration>
|
|
<VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\</VcpkgRoot>
|
|
</PropertyGroup>
|
|
|
|
<ItemDefinitionGroup Condition="'$(VcpkgEnabled)' == 'true'">
|
|
<Link>
|
|
<AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Debug' and '$(VcpkgAutoLink)' != 'false'">%(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib</AdditionalDependencies>
|
|
<AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Release' and '$(VcpkgAutoLink)' != 'false'">%(AdditionalDependencies);$(VcpkgRoot)lib\*.lib</AdditionalDependencies>
|
|
<AdditionalLibraryDirectories Condition="'$(VcpkgConfiguration)' == 'Release'">%(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link</AdditionalLibraryDirectories>
|
|
<AdditionalLibraryDirectories Condition="'$(VcpkgConfiguration)' == 'Debug'">%(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link</AdditionalLibraryDirectories>
|
|
</Link>
|
|
<ClCompile>
|
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(VcpkgRoot)include</AdditionalIncludeDirectories>
|
|
</ClCompile>
|
|
<ResourceCompile>
|
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(VcpkgRoot)include</AdditionalIncludeDirectories>
|
|
</ResourceCompile>
|
|
</ItemDefinitionGroup>
|
|
|
|
<Target Name="VcpkgTripletSelection" BeforeTargets="ClCompile">
|
|
<Message Text="Using triplet "$(VcpkgTriplet)" from "$(VcpkgRoot)"" Importance="Normal" Condition="'$(VcpkgEnabled)' == 'true'"/>
|
|
<Message Text="Not using Vcpkg because VcpkgEnabled is "$(VcpkgEnabled)"" Importance="Normal" Condition="'$(VcpkgEnabled)' != 'true'"/>
|
|
</Target>
|
|
|
|
<Target Name="AppLocalFromInstalled" AfterTargets="CopyFilesToOutputDirectory" BeforeTargets="CopyLocalFilesOutputGroup;RegisterOutput" Condition="'$(VcpkgEnabled)' == 'true'">
|
|
<WriteLinesToFile
|
|
File="$(TLogLocation)$(ProjectName).write.1u.tlog"
|
|
Lines="^$(TargetPath);$([System.IO.Path]::Combine($(ProjectDir),$(IntDir)))vcpkg.applocal.log" Encoding="Unicode"/>
|
|
<Exec Condition="'$(VcpkgConfiguration)' == 'Debug'"
|
|
Command="powershell.exe -ExecutionPolicy Bypass -noprofile -File %22$(MSBuildThisFileDirectory)applocal.ps1%22 %22$(TargetPath)%22 %22$(VcpkgRoot)debug\bin%22 %22$(TLogLocation)$(ProjectName).write.1u.tlog%22 %22$(IntDir)vcpkg.applocal.log%22"
|
|
StandardOutputImportance="Normal">
|
|
</Exec>
|
|
<Exec Condition="'$(VcpkgConfiguration)' == 'Release'"
|
|
Command="powershell.exe -ExecutionPolicy Bypass -noprofile -File %22$(MSBuildThisFileDirectory)applocal.ps1%22 %22$(TargetPath)%22 %22$(VcpkgRoot)bin%22 %22$(TLogLocation)$(ProjectName).write.1u.tlog%22 %22$(IntDir)vcpkg.applocal.log%22"
|
|
StandardOutputImportance="Normal">
|
|
</Exec>
|
|
<ReadLinesFromFile File="$(IntDir)vcpkg.applocal.log">
|
|
<Output TaskParameter="Lines" ItemName="VcpkgAppLocalDLLs" />
|
|
</ReadLinesFromFile>
|
|
<Message Text="@(VcpkgAppLocalDLLs,'%0A')" Importance="Normal" />
|
|
<ItemGroup>
|
|
<ReferenceCopyLocalPaths Include="@(VcpkgAppLocalDLLs)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
</Project>
|