Skip to content

Commit b4b0f53

Browse files
committed
Validate vcpkg features
1 parent 0acc9b4 commit b4b0f53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cmake_generator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,11 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
614614
if (!vcpkg_valid_identifier(package.name)) {
615615
throw std::runtime_error("Invalid vcpkg package name '" + package.name + "'");
616616
}
617+
for (const auto &feature : package.features) {
618+
if (!vcpkg_valid_identifier(feature)) {
619+
throw std::runtime_error("Invalid vcpkg package feature '" + feature + "'");
620+
}
621+
}
617622
if (package.features.empty()) {
618623
ofs << " \"" << package.name << '\"';
619624
} else {

0 commit comments

Comments
 (0)