diff options
| author | Billy O'Neal <bion@microsoft.com> | 2021-09-02 12:33:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-02 12:33:21 -0700 |
| commit | 97e7ac8d748779d04ab1c230abb59f4473a227ed (patch) | |
| tree | 44da600a721e1f7f4ffe65e3e0c5f8c974af6ccd /docs | |
| parent | 7734e8b89d6d511a95ac27f8d8eed913535b592d (diff) | |
| download | vcpkg-97e7ac8d748779d04ab1c230abb59f4473a227ed.tar.gz vcpkg-97e7ac8d748779d04ab1c230abb59f4473a227ed.zip | |
[vcpkg] Repair msbuild damage and workaround the way we integrate on VS2015. (#19767)
* Repair msbuild damage and workaround the way we integrate on VS2015.
This is a fix for a pile of issues discovered by https://github.com/microsoft/vcpkg/pull/18906
* VS 2015 has a bug that the <VcpkgInstalledDir Condition="!$(VcpkgInstalledDir.EndsWith('\'))">$(VcpkgInstalledDir)\</VcpkgInstalledDir> dance we do to get a trailing slash is not applied correctly when VcpkgInstalledDir was edited in the same property group attempting to add the trailing slash.
* We need a trailing slash on VcpkgInstalledDir at all times, but https://github.com/microsoft/vcpkg/pull/16173 damaged this by removing it from TreatAsLocalProperty. Add the right TreatAsLocalPropertys back. Add all such slash defenses to the top of the file just beneath, eliminating need to call Path::Combine and friends by following msbuild "directory properties have a trailing slash" convention.
* Move VcpkgOSTarget and VcpkgPlatformTarget into the .targets, as they aren't intended to be overridable by users and don't appear in our selection dialog box(es).
* Don't bother avoiding setting vcpkg properties when VcpkgEnabled is off; after all, VcpkgEnabled is itself a vcpkg property :). I left attempts to skip creating items since creating items can hit the disk.
* Add _Z to several internal msbuild variables.
* Move VcpkgApplocalDeps to the .props since it's a user setting.
* Don't unconditionally use $(TLogLocation) because it is not set on 2015, and also it's per-project.
* Fixed typo in docs "VcpkgInstalledDirectory", and document the limitation that it doesn't work in 2015.
* In manifest mode, put the installed tree in a subdirectory including the triplet to make changing configurations faster.
Known limitations:
* If you change vcpkg.json without changing any .cpp files, we don't rebuild the dependencies even though we should. I don't know how to fix this but it doesn't appear to be a regression.
* Fix .tlog handling.
* Further defend against modified properties on VS2015.
* Document more VS2015 limitations.
* Remove TreatAsLocalProperty comment.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/users/manifests.md | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/users/manifests.md b/docs/users/manifests.md index ae0ee7eed..0018ff375 100644 --- a/docs/users/manifests.md +++ b/docs/users/manifests.md @@ -441,7 +441,7 @@ See the `--feature-flags=` command line option for more information. ## MSBuild Integration To use manifests with MSBuild, first you need to use an [existing integration method](integration.md#with-msbuild). -Then, simply add a vcpkg.json above your project file (such as in the root of your source repository) and set the +Then, add a vcpkg.json above your project file (such as in the root of your source repository) and set the property `VcpkgEnableManifest` to `true`. You can set this property via the IDE in `Project Properties -> Vcpkg -> Use Vcpkg Manifest`. @@ -453,9 +453,21 @@ Note: It is critical that all project files in a single build consuming the same you need to use different triplets for different projects in your solution, they must consume from different `vcpkg.json` files. +### Known issues + +* Visual Studio 2015 does not correctly track edits to the `vcpkg.json` and `vcpkg-configuration.json` files, and will +not respond to changes unless a `.cpp` is edited. + ### MSBuild Properties -These properties can be defined via the VS GUI under `Project Properties -> Vcpkg` or via a common `.props` file. +When using Visual Studio 2015 integration, these properties can be set in your project file before the + + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + +line, which unfortunately requires manual editing of the `.vcxproj` or passing on the msbuild command line with `/p:`. +With 2017 or later integration, These properties can additionally be set via the Visual Studio GUI under +`Project Properties -> Vcpkg` or via a common `.props` file imported between `Microsoft.Cpp.props` and +`Microsoft.Cpp.targets`. #### `VcpkgEnabled` (Use Vcpkg) @@ -495,7 +507,7 @@ vcpkg.json files will be ignored. This will default to true in the future. This property can be set to "false" to disable automatic dependency restoration on project build. Dependencies can be manually restored via the vcpkg command line. -#### `VcpkgInstalledDirectory` (Installed Directory) +#### `VcpkgInstalledDir` (Installed Directory) This property defines the location where headers and binaries are consumed from. In manifest mode, this directory is created and populated based on your manifest. |
