diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b7300c820..4a77d1adf 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -114,7 +114,10 @@ bool cmTryRunCommand::InitialPass(std::vector const& argv) std::string cacheFile = binaryDirectory; cacheFile += "/CMakeLists.txt"; cmListFileCache::GetInstance()->FlushCache(cacheFile.c_str()); - cmTryCompileCommand::CleanupFiles(binaryDirectory.c_str()); + if(!m_Makefile->GetCMakeInstance()->GetDebugTryCompile()) + { + cmTryCompileCommand::CleanupFiles(binaryDirectory.c_str()); + } return true; }