Skip to content

Commit dabffea

Browse files
committed
Add back the option name as a named condition
1 parent 59fe5c3 commit dabffea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/project_parser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ Project::Project(const Project *parent, const std::string &path, bool build) : p
439439
}
440440
options.push_back(o);
441441

442+
// Add a condition matching the option name
443+
conditions.emplace(o.name, o.name);
444+
442445
// Add an implicit condition for the option
443446
auto ncondition = normalize(o.name);
444447
if (ncondition.find(nproject_prefix) == 0) {
@@ -877,7 +880,6 @@ bool Project::cmake_minimum_version(int major, int minor) const {
877880
}
878881

879882
bool Project::is_condition_name(const std::string &name) {
880-
auto is_named_condition = true;
881883
for (auto ch : name) {
882884
if (!std::isalnum(ch) && ch != '-' && ch != '_') {
883885
return false;

0 commit comments

Comments
 (0)