Enable vcpkg manifest features based on CMake options - #42
Conversation
|
Updating the vcpkg manifest file is absolutely something that should be done. Thanks for looking into this! However, no changes to the
|
| "description": "Enable memory tracking", | ||
| "dependencies": [ | ||
| { | ||
| "name": "lz4", |
There was a problem hiding this comment.
This dependency is generally required when building the telemetry tests, and not specific to memory tracking.
|
So the move of |
That is surprising behaviour, can you elaborate? The "features" in the manifest are purely for dependency acquisition, not for controlling the build options passed to CMake. |
|
So CMake and vcpkg can be friends: if you configure CMake to skip documentation, it will tell vcpkg that it doesn't need that feature, and not install those dependencies. In order for this to work, there is one rule: do the options before your Which also works if Carbonengine already uses this in for example Reference: https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/cmake-integration#vcpkg_manifest_features |
|
Ah, I wasn't aware of that feature - thanks for sharing! It may indeed be useful for building a component as a top-level project, but it's not a requirement for vcpkg per se. 😃 With that in mind, I'd still like to exclude the CMakeLists.txt changes from this PR. The reason is that our CMake "pipeline" is based on an internal template repo. The more a component deviates, the harder it is to integrate the template changes. Because it looks like a genuinely useful change for all components, I'd prefer the path of making the CMakeLists.txt changes in our internal template, and then roll it out that way. 🙂 |
Summary
Currently, vcpkg installs all dependencies. Including Python3, even if you don't build the documentation. This is mostly a problem for targets (like Emscripten), that don't allow for building Python3. But this repository doesn't actually need with its default options.
Instead, use vcpkg manifest features like some other repositories already do (like
meshandresources):option()s beforeproject()VCPKG_MANIFEST_FEATURESI assumed
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)was a left-over guard from the migration to GitHub, and actually has no function anymore. Do let me know if that wasn't the case.AI assistance disclosure
Claude did a lot of triage what
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)was actually about. Otherwise: noneType of change
Linked issue (optional)
What changed
option()Testing
(no more Python3 in default setup)
Platforms tested
Screenshots / captures
Checklist
Full disclosure: I am employed by Fenris Creations, although I have no involvement with the Carbon project. I work on this in my free time under my own name.