From dabffeaed95fb691194e621de3fe5ba806f56ddc Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sat, 6 Jul 2024 14:21:58 +0200 Subject: [PATCH] Add back the option name as a named condition --- src/project_parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/project_parser.cpp b/src/project_parser.cpp index 954a58f..2e3d01b 100644 --- a/src/project_parser.cpp +++ b/src/project_parser.cpp @@ -439,6 +439,9 @@ Project::Project(const Project *parent, const std::string &path, bool build) : p } options.push_back(o); + // Add a condition matching the option name + conditions.emplace(o.name, o.name); + // Add an implicit condition for the option auto ncondition = normalize(o.name); if (ncondition.find(nproject_prefix) == 0) { @@ -877,7 +880,6 @@ bool Project::cmake_minimum_version(int major, int minor) const { } bool Project::is_condition_name(const std::string &name) { - auto is_named_condition = true; for (auto ch : name) { if (!std::isalnum(ch) && ch != '-' && ch != '_') { return false;