diff options
-rw-r--r-- | Source/cmSystemTools.h | 4 | ||||
-rw-r--r-- | Source/cmTryCompileCommand.cxx | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index f5ee0fe..2862406 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -98,6 +98,10 @@ public: { cmSystemTools::s_FatalErrorOccured = true; } + static void SetErrorOccured() + { + cmSystemTools::s_ErrorOccured = true; + } ///! Return true if there was an error at any point. static bool GetFatalErrorOccured() { diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index 3719c6f..dc9d320 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -217,11 +217,18 @@ int cmTryCompileCommand::CoreTryCompileCode( } } + bool erroroc = cmSystemTools::GetErrorOccuredFlag(); + cmSystemTools::ResetErrorOccuredFlag(); std::string output; // actually do the try compile now that everything is setup int res = mf->TryCompile(sourceDirectory, binaryDirectory, projectName, targetName, &cmakeFlags, &output); + if ( erroroc ) + { + cmSystemTools::SetErrorOccured(); + } + // set the result var to the return value to indicate success or failure mf->AddCacheDefinition(argv[0].c_str(), (res == 0 ? "TRUE" : "FALSE"), "Result of TRY_COMPILE", |