diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-10-31 13:32:58 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-10-31 13:32:58 -0700 |
| commit | d58f0c6680b93833a9a1b653c422ba7d2bb00f5d (patch) | |
| tree | 6447589633240e259d8e33807d8c1e97595b83fa /scripts | |
| parent | 71594b6bef76b3510265cf508b24d9221ceede4b (diff) | |
| download | vcpkg-d58f0c6680b93833a9a1b653c422ba7d2bb00f5d.tar.gz vcpkg-d58f0c6680b93833a9a1b653c422ba7d2bb00f5d.zip | |
[integration] Enable static lib integration. Also, detect .vcpkg-root
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/buildsystems/msbuild/vcpkg.targets | 94 |
1 files changed, 54 insertions, 40 deletions
diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 0d89fedd3..a7abe5dba 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -1,44 +1,58 @@ <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)' == '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> - <!-- Expected to ..\..\..\ over scripts\buildsystems\msbuild --> - <VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$(MSBuildThisFileDirectory)..\..\..\installed\$(VcpkgTriplet)\</VcpkgRoot> - </PropertyGroup> - - <ItemDefinitionGroup Condition="'$(VcpkgEnabled)' == 'true'"> - <Link> - <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Debug'">$(VcpkgRoot)debug\lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Release'">$(VcpkgRoot)lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies> - </Link> - <ClCompile> - <AdditionalIncludeDirectories>$(VcpkgRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - </ClCompile> - </ItemDefinitionGroup> + + <Target Name="RuntimeLibraryAnalyze" BeforeTargets="GetClCommandLines;ClCompile"> + <PropertyGroup> + <VcpkgRuntimeLibrary Condition="'%(ClCompile.RuntimeLibrary)' == ''"></VcpkgRuntimeLibrary> + <VcpkgRuntimeLibrary Condition="'%(ClCompile.RuntimeLibrary)' == 'MultiThreadedDebugDLL'"></VcpkgRuntimeLibrary> + <VcpkgRuntimeLibrary Condition="'%(ClCompile.RuntimeLibrary)' == 'MultiThreadedDebug'">-static</VcpkgRuntimeLibrary> + <VcpkgRuntimeLibrary Condition="'%(ClCompile.RuntimeLibrary)' == 'MultiThreadedDLL'"></VcpkgRuntimeLibrary> + <VcpkgRuntimeLibrary Condition="'%(ClCompile.RuntimeLibrary)' == 'MultiThreaded'">-static</VcpkgRuntimeLibrary> + </PropertyGroup> + + <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'Win32||'"> + <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled> + <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-windows$(VcpkgRuntimeLibrary)</VcpkgTriplet> + </PropertyGroup> + + <Message Text="BeforeCompile: RuntimeLibrary=[%(ClCompile.RuntimeLibrary)]" /> + + <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'Win32|Windows Store|10.0'"> + <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled> + <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-uwp$(VcpkgRuntimeLibrary)</VcpkgTriplet> + </PropertyGroup> + + <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'x64||'"> + <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled> + <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-windows$(VcpkgRuntimeLibrary)</VcpkgTriplet> + </PropertyGroup> + + <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'x64|Windows Store|10.0'"> + <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled> + <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-uwp$(VcpkgRuntimeLibrary)</VcpkgTriplet> + </PropertyGroup> + + <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'arm|Windows Store|10.0'"> + <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled> + <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">arm-uwp$(VcpkgRuntimeLibrary)</VcpkgTriplet> + </PropertyGroup> + + <PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'"> + <VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration> + <VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\</VcpkgRoot> + </PropertyGroup> + + <Message Text="Selecting VcpkgTriplet: $(VcpkgTriplet)"/> + <Message Text="Selecting VcpkgRoot: $(VcpkgRoot)"/> + <ItemGroup Condition="'$(VcpkgEnabled)' == 'true'"> + <Link> + <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Debug'">$(VcpkgRoot)debug\lib\*.lib;%(Link.AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Release'">$(VcpkgRoot)lib\*.lib;%(Link.AdditionalDependencies)</AdditionalDependencies> + </Link> + <ClCompile> + <AdditionalIncludeDirectories>$(VcpkgRoot)include;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + </ItemGroup> + </Target> <Target Name="AppLocalFromInstalled" AfterTargets="CopyFilesToOutputDirectory" BeforeTargets="CopyLocalFilesOutputGroup" Condition="'$(VcpkgEnabled)' == 'true' and '$(OutputType)' == 'exe'"> <WriteLinesToFile |
