clean up entire temp directory
This commit is contained in:
parent
1e3ddfeecf
commit
c544cb4307
|
@ -229,21 +229,18 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv)
|
||||||
|
|
||||||
static void cmTryCompileCommandNotUsed(bool){}
|
static void cmTryCompileCommandNotUsed(bool){}
|
||||||
|
|
||||||
void cmTryCompileCommand::CleanupFiles(const char* binDir, bool recursive)
|
void cmTryCompileCommand::CleanupFiles(const char* binDir)
|
||||||
{
|
{
|
||||||
if ( !binDir )
|
if ( !binDir )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmTryCompileCommandNotUsed(recursive);
|
std::string bdir = binDir;
|
||||||
#ifdef WIN32
|
if(bdir.find("CMakeTmp") == std::string::npos)
|
||||||
if ( recursive )
|
|
||||||
{
|
{
|
||||||
std::string bdir = binDir;
|
cmSystemTools::Error("TRY_COMPILE attempt to remove -rf directory that does not contain CMakeTmp:", binDir);
|
||||||
bdir += "/Debug";
|
return;
|
||||||
cmTryCompileCommand::CleanupFiles(bdir.c_str(), false);
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
cmDirectory dir;
|
cmDirectory dir;
|
||||||
dir.Load(binDir);
|
dir.Load(binDir);
|
||||||
|
@ -256,7 +253,14 @@ void cmTryCompileCommand::CleanupFiles(const char* binDir, bool recursive)
|
||||||
std::string fullPath = binDir;
|
std::string fullPath = binDir;
|
||||||
fullPath += "/";
|
fullPath += "/";
|
||||||
fullPath += dir.GetFile(fileNum);
|
fullPath += dir.GetFile(fileNum);
|
||||||
cmSystemTools::RemoveFile(fullPath.c_str());
|
if(cmSystemTools::FileIsDirectory(fullPath.c_str()))
|
||||||
|
{
|
||||||
|
cmTryCompileCommand::CleanupFiles(fullPath.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmSystemTools::RemoveFile(fullPath.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
* code. This way we do not have to rely on the timing and
|
* code. This way we do not have to rely on the timing and
|
||||||
* dependencies of makefiles.
|
* dependencies of makefiles.
|
||||||
*/
|
*/
|
||||||
static void CleanupFiles(const char* binDir, bool recursive=true);
|
static void CleanupFiles(const char* binDir);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* More documentation. */
|
* More documentation. */
|
||||||
|
|
Loading…
Reference in New Issue