Skip to content

Make vcpkg.targets more defensive w.r.t. the naming of build configurations #4454

@FrankHeimes

Description

@FrankHeimes

I'm using Visual Studio 2017 with the vcpkg integration to build my projects.
The vcpkg/scripts/buildsystems/msbuild/vcpkg.targets file is of version #3504, 8. Aug. 2018.

Besides the well known build configurations Debug and Release, I also use other names that prefix or suffix additional words, like Test Debug or Debug CLR. In my project settings, I examine the configuraion name to automatically adjust certain project settings.

The problem with vcpkg is that the condition $(VcpkgConfiguration.StartsWith('Debug')) does match some cases, but not all. Also, creating the property $(VcpkgNormalizedConfiguration) as string and examining it later just to add a sub directory is more verbose than necessary.

I'd like to propose the following:

  • Create a property $(VcpkgConfigSubdir) that is 'debug\' if the configuration contains 'Debug' (case-insensitive) and is empty in all other cases.
  • Remove lot's of redundant code by inserting $(VcpkgConfigSubdir) into the strings.
  • Remove the error message "Vcpkg is unable to link because we cannot decide between Release and Debug libraries." because $(VcpkgConfigSubdir) will always be defined and the test cannot fail anymore.

I have prepared a modified version of vcpkg.targets that works very well that I'd like to submit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:vcpkg-featureThe issue is a new capability of the tool that doesn’t already exist and we haven’t committed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions