mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 14:47:58 +08:00
[vcpkg] Two bug fixes and some improvements in buildsystems/msbuild (#13755)
* Use IncludePath and LibraryPath properties These tool agnostic properties allow to configure ClCompile and ResourceCompile without repeating the code. This change includes my changes from #4454. * Applied changes as described in #13753 * Fixed warning and error in vcpkg end-to-end tests * Fixed incorrect warning "we found a manifest file in \." * Fixed still failing integration test. See discussion in #13753. * Code Review Correction Removed stray double quote reported by @strega-nil * change display name Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
parent
678e3057d6
commit
e126e3eed7
@ -1,77 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Rule
|
||||
Name="VcpkgOptions"
|
||||
DisplayName="Vcpkg"
|
||||
PageTemplate="generic"
|
||||
Description="Vcpkg"
|
||||
xmlns="http://schemas.microsoft.com/build/2009/properties">
|
||||
<Rule.Categories>
|
||||
<Category Name="General" DisplayName="General" Description="General" />
|
||||
</Rule.Categories>
|
||||
<Rule.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="true" />
|
||||
</Rule.DataSource>
|
||||
<BoolProperty Name="VcpkgEnabled"
|
||||
DisplayName="Use Vcpkg"
|
||||
Description="Use Vcpkg for includes and libraries."
|
||||
Category="General"
|
||||
Default="true">
|
||||
</BoolProperty>
|
||||
<BoolProperty Name="VcpkgEnableManifest"
|
||||
DisplayName="Use Vcpkg Manifest"
|
||||
Description="Use the vcpkg manifest file to define your dependencies."
|
||||
Category="General"
|
||||
Default="false">
|
||||
</BoolProperty>
|
||||
<BoolProperty Name="VcpkgManifestInstall"
|
||||
DisplayName="Install vcpkg dependencies"
|
||||
Description="Install dependencies from the vcpkg manifest."
|
||||
Category="General"
|
||||
Default="true">
|
||||
</BoolProperty>
|
||||
<BoolProperty Name="VcpkgUseStatic"
|
||||
DisplayName="Use static libraries"
|
||||
Description="Vcpkg can build static libraries (e.g. x64-windows-static). This options changes the default triplet to use these static libraries by appending -static to $(VcpkgTriplet). This will not be shown in the evaluation of the Triplet within the UI."
|
||||
Category="General"
|
||||
Default="false">
|
||||
</BoolProperty>
|
||||
<BoolProperty Name="VcpkgAutoLink"
|
||||
DisplayName="Use AutoLink"
|
||||
Description="Enables automatic linking with libraries build using Vcpkg. Does not work with lld-link.exe."
|
||||
Category="General"
|
||||
Default="true">
|
||||
</BoolProperty>
|
||||
<StringProperty Name="VcpkgTriplet"
|
||||
DisplayName="Triplet"
|
||||
Description="Specifies the triplet used by Vcpkg"
|
||||
Category="General"
|
||||
Subtype="Text">
|
||||
</StringProperty>
|
||||
<StringProperty Name="VcpkgRoot"
|
||||
DisplayName="Vcpkg Root"
|
||||
Description="Root path where Vcpkg is located. Be careful with changing this one. It is, for example, unable to update this property page from the new location without restarting visual studio."
|
||||
Category="General"
|
||||
Subtype="folder"
|
||||
Visible="false">
|
||||
</StringProperty>
|
||||
<StringProperty Name="VcpkgManifestRoot"
|
||||
DisplayName="Vcpkg Manifest Root"
|
||||
Description="The path to the directory which contains the manifest file, and the vcpkg_installed directory."
|
||||
Category="General"
|
||||
Subtype="folder"
|
||||
Visible="false">
|
||||
</StringProperty>
|
||||
<StringProperty Name="VcpkgCurrentInstalledDir"
|
||||
DisplayName="Package install directory"
|
||||
Description="Defines the direct path to the installed Vcpkg packages. Only change this if you know what you are doing!"
|
||||
Category="General"
|
||||
Subtype="folder"
|
||||
Visible="false">
|
||||
</StringProperty>
|
||||
<EnumProperty Name="VcpkgConfiguration" DisplayName="Vcpkg Configuration" Description="Specifies if release or debug libraries build with vcpkg should be used." Category="General">
|
||||
<EnumValue Name="Release" Switch="Release" DisplayName="Release" Description="Uses release libraries">
|
||||
</EnumValue>
|
||||
<EnumValue Name="Debug" Switch="Debug" DisplayName="Debug" Description="Uses debug libraries">
|
||||
</EnumValue>
|
||||
</EnumProperty>
|
||||
</Rule>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Rule Name="VcpkgOptions" DisplayName="vcpkg" PageTemplate="generic" Description="Vcpkg"
|
||||
xmlns="http://schemas.microsoft.com/build/2009/properties">
|
||||
|
||||
<Rule.Categories>
|
||||
<Category Name="General" DisplayName="General" Description="General Vcpkg Configuration" />
|
||||
<Category Name="Conditional" DisplayName="Target and Configuration Specific" Description="Conditional Vcpkg Configuration" />
|
||||
</Rule.Categories>
|
||||
|
||||
<Rule.DataSource>
|
||||
<!-- Note: HasConfigurationCondition must be either "true" or ommitted. Otherwise, the vcpkg property sheet will not be displayed. -->
|
||||
<!-- Note: Remove all instances of 'Label="Vcpkg"' from this file if the vcpkg property sheet does not display any values. -->
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="true" />
|
||||
</Rule.DataSource>
|
||||
|
||||
<BoolProperty Name="VcpkgEnabled" DisplayName="Use Vcpkg" Category="General" Default="true"
|
||||
Description="Use Vcpkg for includes and libraries.">
|
||||
<BoolProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" />
|
||||
</BoolProperty.DataSource>
|
||||
</BoolProperty>
|
||||
|
||||
<BoolProperty Name="VcpkgEnableManifest" DisplayName="Use Vcpkg Manifest" Category="General" Default="false"
|
||||
Description="Use the vcpkg manifest file to define your dependencies.">
|
||||
<BoolProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" />
|
||||
</BoolProperty.DataSource>
|
||||
</BoolProperty>
|
||||
|
||||
<BoolProperty Name="VcpkgManifestInstall" DisplayName="Install Vcpkg Dependencies" Category="General" Default="true"
|
||||
Description="Install dependencies from the vcpkg manifest.">
|
||||
<BoolProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" />
|
||||
</BoolProperty.DataSource>
|
||||
</BoolProperty>
|
||||
|
||||
<BoolProperty Name="VcpkgAutoLink" DisplayName="Use AutoLink" Category="General" Default="true"
|
||||
Description="Enables automatic linking with libraries build using Vcpkg. Does not work with lld-link.exe.">
|
||||
<BoolProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" />
|
||||
</BoolProperty.DataSource>
|
||||
</BoolProperty>
|
||||
|
||||
<StringProperty Name="VcpkgRoot" DisplayName="Vcpkg Root" Category="General" Subtype="folder" Visible="false"
|
||||
Description="Root path where Vcpkg is located. Be careful with changing this one. It is, for example, unable to update this property page from the new location without restarting visual studio.">
|
||||
<StringProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" />
|
||||
</StringProperty.DataSource>
|
||||
</StringProperty>
|
||||
|
||||
<StringProperty Name="VcpkgManifestRoot" DisplayName="Vcpkg Manifest Root" Category="General" Subtype="folder" Visible="false"
|
||||
Description="The path to the directory which contains the manifest file, and the vcpkg_installed directory.">
|
||||
<StringProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" />
|
||||
</StringProperty.DataSource>
|
||||
</StringProperty>
|
||||
|
||||
<StringProperty Name="VcpkgCurrentInstalledDir" DisplayName="Package install directory" Category="General" Subtype="folder" Visible="false"
|
||||
Description="Defines the direct path to the installed Vcpkg packages.">
|
||||
<StringProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" />
|
||||
</StringProperty.DataSource>
|
||||
</StringProperty>
|
||||
|
||||
<BoolProperty Name="VcpkgUseStatic" DisplayName="Use Static Libraries" Category="Conditional" Default="false"
|
||||
Description="Vcpkg can build static libraries (e.g. x64-windows-static). This options changes the default triplet to use these static libraries by appending -static to $(VcpkgTriplet). This will not be shown in the evaluation of the Triplet within the UI." />
|
||||
|
||||
<StringProperty Name="VcpkgTriplet" DisplayName="Triplet" Category="Conditional" Subtype="Text"
|
||||
Description="Specifies the triplet used by Vcpkg. Does not include the '-static' suffix that may be added by the 'Use static libraries' flag." />
|
||||
|
||||
<EnumProperty Name="VcpkgConfiguration" DisplayName="Vcpkg Configuration" Category="Conditional"
|
||||
Description="Specifies if release or debug libraries build with vcpkg should be used.">
|
||||
<EnumValue Name="Release" Description="Uses release libraries" />
|
||||
<EnumValue Name="Debug" Description="Uses debug libraries" />
|
||||
</EnumProperty>
|
||||
|
||||
</Rule>
|
||||
|
@ -1,41 +1,34 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VcpkgHasProps>true</VcpkgHasProps>
|
||||
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
||||
<VcpkgAutoLink Condition="'$(VcpkgAutoLink)' == ''">true</VcpkgAutoLink>
|
||||
<VcpkgUseStatic Condition="'$(VcpkgUseStatic)' == ''">false</VcpkgUseStatic>
|
||||
<VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))</VcpkgRoot>
|
||||
<VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration>
|
||||
<VcpkgPageSchema Condition="'$(VcpkgPageSchema)' == ''">$(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg-general.xml</VcpkgPageSchema>
|
||||
</PropertyGroup>
|
||||
<!-- Do not define derived properties here. This file may be imported once and some of the properties below may be overridden afterwards -->
|
||||
|
||||
<!-- Set default OS Target-->
|
||||
<PropertyGroup Condition="'$(ApplicationType)|$(ApplicationTypeRevision)' == 'Windows Store|10.0'">
|
||||
<VcpkgOSTarget Condition="'$(VcpkgOSTarget)' == ''">uwp</VcpkgOSTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<VcpkgOSTarget Condition="'$(VcpkgOSTarget)' == ''">windows</VcpkgOSTarget>
|
||||
<PropertyGroup Condition="'$(VcpkgOSTarget)' == ''">
|
||||
<VcpkgOSTarget>windows</VcpkgOSTarget>
|
||||
<VcpkgOSTarget Condition="'$(ApplicationType)|$(ApplicationTypeRevision)' == 'Windows Store|10.0'">uwp</VcpkgOSTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Set default Platform Target. $(PlatformTarget) is not available at the top of the .vcxproj file. -->
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Win32'">
|
||||
<VcpkgPlatformTarget Condition="'$(VcpkgPlatformTarget)' == ''">x86</VcpkgPlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<VcpkgPlatformTarget Condition="'$(VcpkgPlatformTarget)' == ''">$(Platform)</VcpkgPlatformTarget>
|
||||
<PropertyGroup Condition="'$(VcpkgPlatformTarget)' == ''">
|
||||
<VcpkgPlatformTarget>$(Platform)</VcpkgPlatformTarget>
|
||||
<VcpkgPlatformTarget Condition="'$(Platform)' == 'Win32'">x86</VcpkgPlatformTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Manifest files -->
|
||||
<PropertyGroup>
|
||||
<VcpkgPropsImported>true</VcpkgPropsImported>
|
||||
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
||||
<VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration>
|
||||
<VcpkgUseStatic Condition="'$(VcpkgUseStatic)' == ''">false</VcpkgUseStatic>
|
||||
<VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..\..\..'))</VcpkgRoot>
|
||||
|
||||
<VcpkgAutoLink Condition="'$(VcpkgAutoLink)' == ''">true</VcpkgAutoLink>
|
||||
<!-- Deactivate Autolinking if lld is used as a linker. (Until a better way to solve the problem is found!).
|
||||
Tried to add /lib as a parameter to the linker call but was unable to find a way to pass it as the first parameter. -->
|
||||
<VcpkgAutoLink Condition="'$(UseLldLink)' == 'true'">false</VcpkgAutoLink>
|
||||
|
||||
<!-- Manifest files -->
|
||||
<VcpkgEnableManifest Condition="'$(VcpkgEnableManifest)' == ''">false</VcpkgEnableManifest>
|
||||
<VcpkgManifestInstall Condition="'$(VcpkgManifestInstall)' == ''">true</VcpkgManifestInstall>
|
||||
<VcpkgManifestRoot>$([MSbuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), vcpkg.json))</VcpkgManifestRoot>
|
||||
<VcpkgManifestRoot Condition="'$(VcpkgManifestRoot)' != ''">$([MSbuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), vcpkg.json))</VcpkgManifestRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Set other defaults-->
|
||||
<PropertyGroup>
|
||||
<VcpkgUserTriplet Condition="'$(VcpkgUserTriplet)' == ''">$(VcpkgPlatformTarget)-$(VcpkgOSTarget)</VcpkgUserTriplet>
|
||||
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">$(VcpkgUserTriplet)</VcpkgTriplet>
|
||||
<VcpkgPageSchema>$(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg-general.xml</VcpkgPageSchema>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
@ -1,77 +1,35 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="VcpkgRoot;VcpkgCurrentInstalledDir">
|
||||
<!-- Setting reasonable defaults if vcpkg.props was not loaded-->
|
||||
<PropertyGroup Condition="'$(VcpkgHasProps)'!='true'" >
|
||||
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
|
||||
<VcpkgAutoLink Condition="'$(VcpkgAutoLink)' == ''">true</VcpkgAutoLink>
|
||||
<VcpkgUseStatic Condition="'$(VcpkgUseStatic)' == ''">false</VcpkgUseStatic>
|
||||
<VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))</VcpkgRoot>
|
||||
<VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration>
|
||||
<VcpkgPageSchema Condition="'$(VcpkgPageSchema)' == ''">$(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg-general.xml</VcpkgPageSchema>
|
||||
<VcpkgEnableManifest Condition="'$(VcpkgEnableManifest)' == ''">false</VcpkgEnableManifest>
|
||||
<VcpkgManifestInstall Condition="'$(VcpkgManifestInstall)' == ''">true</VcpkgManifestInstall>
|
||||
<VcpkgManifestRoot>$([MSbuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), vcpkg.json))</VcpkgManifestRoot>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="VcpkgConfigSubdir;VcpkgCurrentInstalledDir;VcpkgInstalledDir;VcpkgNormalizedConfiguration">
|
||||
|
||||
<!-- Import default properties if not done yet. This does not overwrite any previously defined properties. -->
|
||||
<Import Condition="'$(VcpkgPropsImported)' != 'true'" Project="vcpkg.props" />
|
||||
|
||||
<!-- Define properties derived from those defined in vcpkg.props, in the project file or specified on the command line. -->
|
||||
<PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'">
|
||||
<!-- Triplet defining platform, OS, and linkage -->
|
||||
<VcpkgLinkage />
|
||||
<VcpkgLinkage Condition="'$(VcpkgUseStatic)' == 'true'">-static</VcpkgLinkage>
|
||||
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">$(VcpkgPlatformTarget)-$(VcpkgOSTarget)$(VcpkgLinkage)</VcpkgTriplet>
|
||||
|
||||
<!-- Note: Overwrite VcpkgPageSchema with a non-existing path to disable the VcPkg property sheet in your projects -->
|
||||
<VcpkgPageSchema Condition="'$(VcpkgPageSchema)' == ''">$([System.IO.Path]::Combine($(VcpkgRoot), 'scripts\buildsystems\msbuild\vcpkg-general.xml'))</VcpkgPageSchema>
|
||||
|
||||
<VcpkgInstalledDir>$([System.IO.Path]::Combine($(VcpkgRoot), 'installed'))</VcpkgInstalledDir>
|
||||
<VcpkgInstalledDir Condition="'$(VcpkgEnableManifest)' == 'true'">$([System.IO.Path]::Combine($(VcpkgManifestRoot), 'vcpkg_installed'))</VcpkgInstalledDir>
|
||||
<VcpkgCurrentInstalledDir Condition="'$(VcpkgCurrentInstalledDir)' == ''">$([System.IO.Path]::Combine($(VcpkgInstalledDir), $(VcpkgTriplet)))</VcpkgCurrentInstalledDir>
|
||||
<VcpkgCurrentInstalledDir Condition="!$(VcpkgCurrentInstalledDir.EndsWith('\'))">$(VcpkgCurrentInstalledDir)\</VcpkgCurrentInstalledDir>
|
||||
<VcpkgNormalizedConfiguration Condition="$(VcpkgConfiguration.StartsWith('Debug'))">Debug</VcpkgNormalizedConfiguration>
|
||||
<VcpkgNormalizedConfiguration Condition="$(VcpkgConfiguration.StartsWith('Release')) or '$(VcpkgConfiguration)' == 'RelWithDebInfo' or '$(VcpkgConfiguration)' == 'MinSizeRel'">Release</VcpkgNormalizedConfiguration>
|
||||
<VcpkgConfigSubdir Condition="'$(VcpkgNormalizedConfiguration)' == 'Debug'">debug\</VcpkgConfigSubdir>
|
||||
<VcpkgApplocalDeps Condition="'$(VcpkgApplocalDeps)' == ''">true</VcpkgApplocalDeps>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Set default OS Target-->
|
||||
<PropertyGroup Condition="'$(ApplicationType)|$(ApplicationTypeRevision)' == 'Windows Store|10.0' And '$(VcpkgHasProps)'!='true'">
|
||||
<VcpkgOSTarget Condition="'$(VcpkgOSTarget)' == ''">uwp</VcpkgOSTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(VcpkgHasProps)'!='true'" >
|
||||
<VcpkgOSTarget Condition="'$(VcpkgOSTarget)' == ''">windows</VcpkgOSTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Set default Platform Target-->
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Win32'">
|
||||
<VcpkgPlatformTarget Condition="'$(VcpkgPlatformTarget)' == ''">x86</VcpkgPlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<VcpkgPlatformTarget Condition="'$(VcpkgPlatformTarget)' == ''">$(Platform)</VcpkgPlatformTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Set other defaults-->
|
||||
<PropertyGroup Condition="'$(VcpkgHasProps)'!='true'" >
|
||||
<VcpkgUserTriplet Condition="'$(VcpkgUserTriplet)' == ''">$(VcpkgPlatformTarget)-$(VcpkgOSTarget)</VcpkgUserTriplet>
|
||||
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">$(VcpkgUserTriplet)</VcpkgTriplet>
|
||||
<VcpkgCurrentInstalledDir Condition="'$(VcpkgCurrentInstalledDir)' == ''">$(VcpkgRoot)\installed\$(VcpkgTriplet)\</VcpkgCurrentInstalledDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--Import property page for vcpkg -->
|
||||
<ItemGroup Condition="'$(VcpkgPageSchema)' != '' ">
|
||||
<!-- Import property page 'Vcpkg' -->
|
||||
<ItemGroup Condition="'$(VcpkgPageSchema)' != '' and exists('$(VcpkgPageSchema)')">
|
||||
<PropertyPageSchema Include="$(VcpkgPageSchema)">
|
||||
<Context>Project</Context>
|
||||
</PropertyPageSchema>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Update properties if manifests are enabled or disabled -->
|
||||
<PropertyGroup Condition="'$(VcpkgEnableManifest)' == 'true'">
|
||||
<VcpkgInstalledDir>$(VcpkgManifestRoot)\vcpkg_installed\</VcpkgInstalledDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(VcpkgEnableManifest)' != 'true'">
|
||||
<VcpkgInstalledDir>$(VcpkgRoot)\installed\</VcpkgInstalledDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Update properties if using static libs-->
|
||||
<PropertyGroup Condition="'$(VcpkgUseStatic)' == 'true'">
|
||||
<VcpkgTriplet>$(VcpkgUserTriplet)-static</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(VcpkgCurrentInstalledDir)' == ''">
|
||||
<VcpkgCurrentInstalledDir>$(VcpkgInstalledDir)$(VcpkgTriplet)</VcpkgCurrentInstalledDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'">
|
||||
<VcpkgNormalizedConfiguration Condition="$(VcpkgConfiguration.StartsWith('Debug'))">Debug</VcpkgNormalizedConfiguration>
|
||||
<VcpkgNormalizedConfiguration Condition="$(VcpkgConfiguration.StartsWith('Release')) or '$(VcpkgConfiguration)' == 'RelWithDebInfo' or '$(VcpkgConfiguration)' == 'MinSizeRel'">Release</VcpkgNormalizedConfiguration>
|
||||
<VcpkgConfigSubdir Condition="'$(VcpkgNormalizedConfiguration)' == 'Debug'">debug\</VcpkgConfigSubdir>
|
||||
<VcpkgRoot Condition="!$(VcpkgRoot.EndsWith('\'))">$(VcpkgRoot)\</VcpkgRoot>
|
||||
<VcpkgCurrentInstalledDir Condition="!$(VcpkgCurrentInstalledDir.EndsWith('\'))">$(VcpkgCurrentInstalledDir)\</VcpkgCurrentInstalledDir>
|
||||
<VcpkgManifestRoot Condition="'$(VcpkgManifestRoot)' != '' and !$(VcpkgManifestRoot.EndsWith('\'))">$(VcpkgManifestRoot)\</VcpkgManifestRoot>
|
||||
<VcpkgApplocalDeps Condition="'$(VcpkgApplocalDeps)' == ''">true</VcpkgApplocalDeps>
|
||||
<!-- Deactivate Autolinking if lld is used as a linker. (Until a better way to solve the problem is found!).
|
||||
Tried to add /lib as a parameter to the linker call but was unable to find a way to pass it as the first parameter. -->
|
||||
<VcpkgAutoLink Condition="'$(UseLldLink)' == 'true'">false</VcpkgAutoLink>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(VcpkgEnabled)' == 'true'">
|
||||
<Link>
|
||||
<AdditionalDependencies Condition="'$(VcpkgAutoLink)' != 'false'">%(AdditionalDependencies);$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\*.lib</AdditionalDependencies>
|
||||
@ -85,28 +43,32 @@
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<Target Name="VcpkgCheckManifestRoot" Condition="'$(VcpkgEnabled)' == 'true'" BeforeTargets="VcpkgInstallManifestDependencies">
|
||||
<Error Text="The Vcpkg manifest was enabled, but we couldn't find a manifest file (vcpkg.json) in any directories above $(MSBuildProjectDirectory). Please add a manifest, disable manifests in your properties page, or pass /p:VcpkgEnableManifest=false." Condition="'$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestRoot)' == ''" />
|
||||
<Message Text="The Vcpkg manifest was disabled, but we found a manifest file in $(VcpkgManifestRoot). You may want to enable vcpkg manifests in your properties page or pass /p:VcpkgEnableManifest=true to the msbuild invocation." Importance="High" Condition="'$(VcpkgEnableManifest)' != 'true' and '$(VcpkgManifestRoot)' != ''" />
|
||||
<Target Name="VcpkgCheckManifestRoot" BeforeTargets="VcpkgInstallManifestDependencies" Condition="'$(VcpkgEnabled)' == 'true'">
|
||||
<Error Text="The Vcpkg manifest was enabled, but we couldn't find a manifest file (vcpkg.json) in any directories above $(MSBuildProjectDirectory). Please add a manifest, disable manifests in your properties page, or pass /p:VcpkgEnableManifest=false."
|
||||
Condition="'$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestRoot)' == ''" />
|
||||
<Message Text="The Vcpkg manifest was disabled, but we found a manifest file in $(VcpkgManifestRoot). You may want to enable vcpkg manifests in your properties page or pass /p:VcpkgEnableManifest=true to the msbuild invocation."
|
||||
Importance="High" Condition="'$(VcpkgEnableManifest)' != 'true' and '$(VcpkgManifestRoot)' != ''" />
|
||||
</Target>
|
||||
|
||||
<Target Name="VcpkgTripletSelection" BeforeTargets="ClCompile">
|
||||
<Message Text="Using triplet "$(VcpkgTriplet)" from "$(VcpkgCurrentInstalledDir)"" Importance="Normal" Condition="'$(VcpkgEnabled)' == 'true'"/>
|
||||
<Message Text="Not using Vcpkg because VcpkgEnabled is "$(VcpkgEnabled)"" Importance="Normal" Condition="'$(VcpkgEnabled)' != 'true'"/>
|
||||
<Message Text="Using triplet "$(VcpkgTriplet)" from "$(VcpkgCurrentInstalledDir)""
|
||||
Importance="Normal" Condition="'$(VcpkgEnabled)' == 'true'"/>
|
||||
<Message Text="Not using Vcpkg because VcpkgEnabled is "$(VcpkgEnabled)""
|
||||
Importance="Normal" Condition="'$(VcpkgEnabled)' != 'true'"/>
|
||||
<Message Text="Vcpkg is unable to link because we cannot decide between Release and Debug libraries. Please define the property VcpkgConfiguration to be 'Release' or 'Debug' (currently '$(VcpkgConfiguration)')."
|
||||
Importance="High" Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgNormalizedConfiguration)' == ''"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="VcpkgInstallManifestDependencies" Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestInstall)' == 'true'" BeforeTargets="ClCompile">
|
||||
<Target Name="VcpkgInstallManifestDependencies" BeforeTargets="ClCompile"
|
||||
Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestInstall)' == 'true'">
|
||||
<Message Text="Installing vcpkg dependencies" Importance="High" />
|
||||
<Exec Command="%22$(VcpkgRoot)vcpkg.exe%22 install --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22" StandardOutputImportance="High" />
|
||||
<Exec Command="%22$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe'))%22 install --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22"
|
||||
StandardOutputImportance="High" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AppLocalFromInstalled" AfterTargets="CopyFilesToOutputDirectory" BeforeTargets="CopyLocalFilesOutputGroup;RegisterOutput" Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgApplocalDeps)' == 'true'">
|
||||
<Target Name="AppLocalFromInstalled" AfterTargets="CopyFilesToOutputDirectory" BeforeTargets="CopyLocalFilesOutputGroup;RegisterOutput"
|
||||
Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgApplocalDeps)' == 'true'">
|
||||
<Message Text="[vcpkg] Starting VcpkgApplocalDeps" Importance="low" />
|
||||
<WriteLinesToFile
|
||||
File="$(TLogLocation)$(ProjectName).write.1u.tlog"
|
||||
Lines="^$(TargetPath);$([System.IO.Path]::Combine($(ProjectDir),$(IntDir)))vcpkg.applocal.log" Encoding="Unicode"/>
|
||||
<PropertyGroup>
|
||||
<_VcpkgAppLocalPowerShellCommonArguments>-ExecutionPolicy Bypass -noprofile -File "$(MSBuildThisFileDirectory)applocal.ps1" "$(TargetPath)" "$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)bin" "$(TLogLocation)$(ProjectName).write.1u.tlog" "$(IntDir)vcpkg.applocal.log"</_VcpkgAppLocalPowerShellCommonArguments>
|
||||
</PropertyGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user