-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a command-line option to set the default build type. #1231
Conversation
This removes the need to wrap it in an `Optional`.
…rt via `CMAKE_DEFAULT_BUILD_TYPE`.
…triplets. Fixes post-build validation warnings.
This is a triplet setting because, in general, the whole universe needs to agree on the value.
will fail, because debug curl is going to need debug zlib, and as far as vcpkg is concerned, debug zlib is installed. Given that this is a setting the whole world needs to agree on, the right place for it to go is the triplet. As a result I am weakly against this change. I could see an argument for some sort of system that lets common triplet combos be set by the user directly in manifest mode, but that would still be a different triplet, not a specific command line escape hatch for one particular triplet setting. |
That's why |
I am also against it. Furthermore debug only builds are mostly broken by design. |
Yes, but why is
|
I'm also against this change. This belongs in the triplet file. |
I mean with per port customization you can also do the same with a triplet file 😄 Imho it would be nice to have something like a "dynamic triplet" that derives the content of the triplet file from the triplet name, then you also don't need to pollute the triplet folder of the vcpkg repo (edit: or the overlay triplet folder) with all possible combinations of triplets. |
... if we could transform all inputs into an ABI hashing input... |
Sounds like this could be a problem? The only challenge could be to get the same triplet abi as for the file based triplets. |
you could write such a triplet already. Just include a file with the logic in the triplet instead of copying the code all over the triplets
That feature is called overlay triplets is it not ? |
The first challenge is to not get the same ABI hash for all filenames of the dynamic triplet. |
It depends how you implement it. But if you generate a file you could simply add a comment to the file and get a different file hash <=> triplet abi. |
@BillyONeal of the options listed in https://learn.microsoft.com/en-us/vcpkg/users/triplets, Having to choose between either double the build times to build binaries we won't need, or duplicating our triplet files to have only one line added and forgoing relying on vcpkg's automatic platform detection (our custom triplets have the same name as the default ones) is a current deficiency of vcpkg that I would like to fix. |
As has been stated above, We do believe the current "single configuration" system needs improvement, but we don't think adding this command line flag is the right direction. Thank you for your contribution! |
As part of fixing microsoft/vcpkg#1626, this PR introduces the
--x-build-type
setting to thevcpkg install
command. When this setting is specified with a value ofrelease
, ordebug
, it sets theVCPKG_DEFAULT_BUILD_TYPE
variable to the CMake script invocation that builds a port.The
port.cmake
file at microsoft/vcpkg will use this variable to initializeVCPKG_BUILD_TYPE
, enabling building dependencies in only Release or Debug mode without writing a custom triplet, addressing a long-standing usability issue of vcpkg. For compatibility, if the triplet file setsVCPKG_BUILD_TYPE
itself, it prevails over--x-build-type
.If
--x-build-type
is specified, its value becomes part of the ABI hash. The setting is available only when installing in manifest mode; it would be weird to support it in classic mode, where packages of varied build configurations would coexist under the same triplet.