COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases

Fixes: #24186
This commit is contained in:
Marc Chevrier
2022-12-08 14:52:56 +01:00
parent ff875ed859
commit 7480fa0a5f
18 changed files with 114 additions and 2 deletions
+6 -1
View File
@@ -3377,7 +3377,12 @@ void cmLocalGenerator::AppendDefines(
if (!this->CheckDefinition(d.Value)) {
continue;
}
defines.insert(d);
// remove any leading -D
if (cmHasLiteralPrefix(d.Value, "-D")) {
defines.emplace(d.Value.substr(2), d.Backtrace);
} else {
defines.insert(d);
}
}
}