mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-03 06:10:28 +00:00
cmake: command arguments which use '=' behave consistently
Fixes: #21351 The `profiling-format`, `profiling-output`, and `preset` all would crash when invoked without a trailing `=`.
This commit is contained in:
@@ -941,19 +941,19 @@ void cmake::SetArgs(const std::vector<std::string>& args)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if !defined(CMAKE_BOOTSTRAP)
|
#if !defined(CMAKE_BOOTSTRAP)
|
||||||
} else if (cmHasLiteralPrefix(arg, "--profiling-format")) {
|
} else if (cmHasLiteralPrefix(arg, "--profiling-format=")) {
|
||||||
profilingFormat = arg.substr(strlen("--profiling-format="));
|
profilingFormat = arg.substr(strlen("--profiling-format="));
|
||||||
if (profilingFormat.empty()) {
|
if (profilingFormat.empty()) {
|
||||||
cmSystemTools::Error("No format specified for --profiling-format");
|
cmSystemTools::Error("No format specified for --profiling-format");
|
||||||
}
|
}
|
||||||
} else if (cmHasLiteralPrefix(arg, "--profiling-output")) {
|
} else if (cmHasLiteralPrefix(arg, "--profiling-output=")) {
|
||||||
profilingOutput = arg.substr(strlen("--profiling-output="));
|
profilingOutput = arg.substr(strlen("--profiling-output="));
|
||||||
profilingOutput = cmSystemTools::CollapseFullPath(profilingOutput);
|
profilingOutput = cmSystemTools::CollapseFullPath(profilingOutput);
|
||||||
cmSystemTools::ConvertToUnixSlashes(profilingOutput);
|
cmSystemTools::ConvertToUnixSlashes(profilingOutput);
|
||||||
if (profilingOutput.empty()) {
|
if (profilingOutput.empty()) {
|
||||||
cmSystemTools::Error("No path specified for --profiling-output");
|
cmSystemTools::Error("No path specified for --profiling-output");
|
||||||
}
|
}
|
||||||
} else if (cmHasLiteralPrefix(arg, "--preset")) {
|
} else if (cmHasLiteralPrefix(arg, "--preset=")) {
|
||||||
presetName = arg.substr(strlen("--preset="));
|
presetName = arg.substr(strlen("--preset="));
|
||||||
if (presetName.empty()) {
|
if (presetName.empty()) {
|
||||||
cmSystemTools::Error("No preset specified for --preset");
|
cmSystemTools::Error("No preset specified for --preset");
|
||||||
|
|||||||
Reference in New Issue
Block a user