Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding support for customized Project configurations? #1638
For now, VCPKG only supports 'Debug' and 'Release' configurations, which means other configurations do not profit from the automatic include, linking, and binaries copying to the output directory at compilation time.
I propose to add a partial support based on configuration name prefix, instead of strict configuration name.
The pre-requisite is the following: It is possible to offer different but compatible configurations binaries.
For example, if I create a using a custom configuration called "ReleaseDev" based on "Release", but disabling optimizations, my DLL "ReleaseDev" should work flawlessly with a "Release" DLL compiled with VCPKG.
AFAIK, the main breaking difference between Debug and Release is the use of the debug or release runtime DLL. Everything else should be compatible (please correct me on the flags I'm wrong).
How it currently works
Currently, the "magic" is done in vcpkg.targets: https://github.com/Microsoft/vcpkg/blob/master/scripts/buildsystems/msbuild/vcpkg.targets
The change I propose
Instead of supporting only 'Release' or 'Debug', I propose to support all configurations starting with 'Release' or 'Debug'.
This would result in something like the following change in vcpkg.targets file:
... the difference being
I've successfully tested the proposed modification above on my machine.
And, IMHO, adding to the specification that all user-defined configuration starting with "Release" should be compatible with the default "Release" (same for "Debug") is a good compromise.
So, is this something worth exploring? Either with the solution above, or a variation?
Edit: Just in case the solution above is good enough, I proposed the change in the request below.
So, you could add:
<PropertyGroup> <VcpkgConfiguration Condition="'$(Configuration)' == 'RelWithDebInfo'">Release</VcpkgConfiguration> </PropertyGroup>
to your project file's globals section and we'll see and match against "Release".
@ras0219-msft Is your solution what you recommend for all the cases (including the ones I describe)?
(i.e. I didn't realize this was a possible solution, even in my case. I find your solution actually better than the "hack" in my pull requests, or the hacks I tried at home - I actually went through a few hacks to produce similar results, after failing to find a way to do it cleanly).
If yes, is there a documentation on the subject?
If there isn't a documentation, I suggest we should update the FAQ:
... with something like:
If everyone agrees, I can cancel this issue and the associated pull request, and update the FAQ documentation instead.
I have two questions, and one proposal:
Do we make this case-insensitive?
Do we make the test case insensitive as suggested by @pravic ?
What about other CMake "configurations"
For the sake of a better "by-default" experience, should the pull request also support CMake's "configurations" (for lack of a better term)? That is:
(I've looked at VCXPROJ files generated by CMake, and they seem compatible with "Release")
I propose two pull requests:
The basic support (for strict "Release"/"Debug" prefix), as well as the relevant documentation was done:
Do I close this issue now? Or do I conclude by providing:
... as well as the relevant documentation update?