CMake: Skip empty link.txt lines (#13845)

In the implementation of "cmake -E cmake_link_script", skip lines from
the input file that are empty or contain only whitespace.  Do not try to
run a child with no command line.
This commit is contained in:
Brad King 2013-01-11 10:57:39 -05:00
parent 5929086634
commit 8ff1d4714f
1 changed files with 6 additions and 0 deletions

View File

@ -3299,6 +3299,12 @@ int cmake::ExecuteLinkScript(std::vector<std::string>& args)
int result = 0;
while(result == 0 && cmSystemTools::GetLineFromStream(fin, command))
{
// Skip empty command lines.
if(command.find_first_not_of(" \t") == command.npos)
{
continue;
}
// Setup this command line.
const char* cmd[2] = {command.c_str(), 0};
cmsysProcess_SetCommand(cp, cmd);