BUG: When error occurs, try compiles should still work
This commit is contained in:
parent
6b56245932
commit
ec3a119480
|
@ -98,6 +98,10 @@ public:
|
||||||
{
|
{
|
||||||
cmSystemTools::s_FatalErrorOccured = true;
|
cmSystemTools::s_FatalErrorOccured = true;
|
||||||
}
|
}
|
||||||
|
static void SetErrorOccured()
|
||||||
|
{
|
||||||
|
cmSystemTools::s_ErrorOccured = true;
|
||||||
|
}
|
||||||
///! Return true if there was an error at any point.
|
///! Return true if there was an error at any point.
|
||||||
static bool GetFatalErrorOccured()
|
static bool GetFatalErrorOccured()
|
||||||
{
|
{
|
||||||
|
|
|
@ -217,11 +217,18 @@ int cmTryCompileCommand::CoreTryCompileCode(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool erroroc = cmSystemTools::GetErrorOccuredFlag();
|
||||||
|
cmSystemTools::ResetErrorOccuredFlag();
|
||||||
std::string output;
|
std::string output;
|
||||||
// actually do the try compile now that everything is setup
|
// actually do the try compile now that everything is setup
|
||||||
int res = mf->TryCompile(sourceDirectory, binaryDirectory,
|
int res = mf->TryCompile(sourceDirectory, binaryDirectory,
|
||||||
projectName, targetName, &cmakeFlags, &output);
|
projectName, targetName, &cmakeFlags, &output);
|
||||||
|
|
||||||
|
if ( erroroc )
|
||||||
|
{
|
||||||
|
cmSystemTools::SetErrorOccured();
|
||||||
|
}
|
||||||
|
|
||||||
// set the result var to the return value to indicate success or failure
|
// set the result var to the return value to indicate success or failure
|
||||||
mf->AddCacheDefinition(argv[0].c_str(), (res == 0 ? "TRUE" : "FALSE"),
|
mf->AddCacheDefinition(argv[0].c_str(), (res == 0 ? "TRUE" : "FALSE"),
|
||||||
"Result of TRY_COMPILE",
|
"Result of TRY_COMPILE",
|
||||||
|
|
Loading…
Reference in New Issue