Skip to content

Commit

Permalink
fallback in case of parse fail
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni authored and alandefreitas committed Jan 26, 2024
1 parent 3d3f398 commit 113ecbc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/Lib/CMakeExecution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,22 @@ getCmakeDefaultGenerator(llvm::StringRef cmakePath)
if (cmakeHelpExp)
{
std::string const cmakeHelp = *std::move(cmakeHelpExp);
return parseCmakeHelpOutput(cmakeHelp);
auto const r = parseCmakeHelpOutput(cmakeHelp);
if (r)
{
return *r;
}
}

Expected<std::string> const cmakeSystemInformationExp = executeCmakeSystemInformation(cmakePath);
if (cmakeSystemInformationExp)
{
std::string const cmakeSystemInformation = *std::move(cmakeSystemInformationExp);
return parseCmakeSystemInformationOutput(cmakeSystemInformation);
auto const r = parseCmakeSystemInformationOutput(cmakeSystemInformation);
if (r)
{
return *r;
}
}

if (llvm::sys::path::extension(cmakePath) == ".exe")
Expand Down

0 comments on commit 113ecbc

Please sign in to comment.