diff options
author | Berk Geveci <berk.geveci@kitware.com> | 2004-03-17 14:42:32 (GMT) |
---|---|---|
committer | Berk Geveci <berk.geveci@kitware.com> | 2004-03-17 14:42:32 (GMT) |
commit | ec3a119480de133849b28b6c98f9953793fb92cc (patch) | |
tree | b297f90e669c4d02f772a8455b8d13da17f29010 /Source/cmTryCompileCommand.cxx | |
parent | 6b5624593288dfbcf1e53dd9f9ac96c06996e62d (diff) | |
download | CMake-ec3a119480de133849b28b6c98f9953793fb92cc.zip CMake-ec3a119480de133849b28b6c98f9953793fb92cc.tar.gz CMake-ec3a119480de133849b28b6c98f9953793fb92cc.tar.bz2 |
BUG: When error occurs, try compiles should still work
Diffstat (limited to 'Source/cmTryCompileCommand.cxx')
-rw-r--r-- | Source/cmTryCompileCommand.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
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", |