ctest: Teach --build-options to allow zero options
The --build-options option consumes all following arguments until either --build-target or --test-command. Fix the logic to allow this to be zero options.
This commit is contained in:
parent
96966b5c80
commit
4d1d7725f3
@ -513,23 +513,14 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
|
|||||||
{
|
{
|
||||||
this->BuildNoClean = true;
|
this->BuildNoClean = true;
|
||||||
}
|
}
|
||||||
if(currentArg.find("--build-options",0) == 0 && idx < allArgs.size() - 1)
|
if(currentArg.find("--build-options",0) == 0)
|
||||||
{
|
{
|
||||||
++idx;
|
while(idx+1 < allArgs.size() &&
|
||||||
bool done = false;
|
allArgs[idx+1] != "--build-target" &&
|
||||||
while(idx < allArgs.size() && !done)
|
allArgs[idx+1] != "--test-command")
|
||||||
{
|
{
|
||||||
|
++idx;
|
||||||
this->BuildOptions.push_back(allArgs[idx]);
|
this->BuildOptions.push_back(allArgs[idx]);
|
||||||
if(idx+1 < allArgs.size()
|
|
||||||
&& (allArgs[idx+1] == "--build-target" ||
|
|
||||||
allArgs[idx+1] == "--test-command"))
|
|
||||||
{
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(currentArg.find("--test-command",0) == 0 && idx < allArgs.size() - 1)
|
if(currentArg.find("--test-command",0) == 0 && idx < allArgs.size() - 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user