Allow disabling default features with vcpkg

This commit is contained in:
Duncan Ogilvie
2024-11-27 14:13:37 +01:00
parent 13a7a8788a
commit e9480a625f
4 changed files with 13 additions and 4 deletions
+6 -1
View File
@@ -847,7 +847,12 @@ Project::Project(const Project *parent, const std::string &path, bool build) : p
std::istringstream feature_stream{features};
std::string feature;
while (std::getline(feature_stream, feature, ',')) {
package.features.emplace_back(feature);
// Disable default features with package-name[core,feature1]
if (feature == "core") {
package.default_features = false;
} else {
package.features.emplace_back(feature);
}
}
} else {
throw_key_error("Invalid package name '" + package_str + "'", "packages", p);