Skip to content

Commit 113ecbc

Browse files
fpelliccionialandefreitas
authored andcommitted
fallback in case of parse fail
1 parent 3d3f398 commit 113ecbc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib/Lib/CMakeExecution.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,22 @@ getCmakeDefaultGenerator(llvm::StringRef cmakePath)
161161
if (cmakeHelpExp)
162162
{
163163
std::string const cmakeHelp = *std::move(cmakeHelpExp);
164-
return parseCmakeHelpOutput(cmakeHelp);
164+
auto const r = parseCmakeHelpOutput(cmakeHelp);
165+
if (r)
166+
{
167+
return *r;
168+
}
165169
}
166170

167171
Expected<std::string> const cmakeSystemInformationExp = executeCmakeSystemInformation(cmakePath);
168172
if (cmakeSystemInformationExp)
169173
{
170174
std::string const cmakeSystemInformation = *std::move(cmakeSystemInformationExp);
171-
return parseCmakeSystemInformationOutput(cmakeSystemInformation);
175+
auto const r = parseCmakeSystemInformationOutput(cmakeSystemInformation);
176+
if (r)
177+
{
178+
return *r;
179+
}
172180
}
173181

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

0 commit comments

Comments
 (0)