Skip to content

Generate only the preset's configuration in multi-config solutions - #169

Merged
ccpisheden merged 1 commit into
mainfrom
cmake-single-config
Dec 1, 2026
Merged

ccpisheden merged 1 commit into
mainfrom
cmake-single-config

Conversation

@ccpisheden

Copy link
Copy Markdown
Contributor

Summary

vcpkg installs dependencies for the preset's triplet only, so every other configuration in a multi-config VS/Xcode solution built silently against libraries of the original triplet's flavor, not the selected one. After this change, only the original flavor is exposed in the IDE.

Linked issue (optional)

None, but fixes an open manhole that people keep falling into by accident

Testing

Generated solution in VS does not contain any other configs anymore; still builds against the correct libraries.

AI assistance

Lots, Claude.

vcpkg installs dependencies for the preset's triplet only, so every other configuration in a multi-config VS/Xcode solution built silently against libraries of the original triplet's flavor, not the selected one. After this change, only the original flavor is exposed in the IDE.

@CCP-Aporia CCP-Aporia left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, and I think it’s a fine change to the CMake set up in light of how vcpkg behaves. The original CMake code comes from the time when we transitioned our one huge VS solution file over to CMake, and wanted to provide a similar experience with a VS solution file generated from that. Of course, given that vcpkg cannot install all carbon binaries in all build flavours at the same time, it makes sense that this now simply requires different VS solution files per build flavour.

The one thing that may be of note here, though, is that CMAKE_BUILD_TYPE now needs to be passed into the configuration phase, which is unusual when using a multi-config generator. The presets do this because vcpkg needs that, but as stated, it’s not “the usual” way.

@ccpisheden
ccpisheden merged commit 99872db into main Dec 1, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants