diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3cf6c0be6..d6c6f563f 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -213,7 +213,6 @@ bool cmFileCommand::HandleWriteCommand(std::vector const& args, file << message; file.close(); cmSystemTools::SetPermissions(fileName.c_str(), mode); - this->Makefile->AddWrittenFile(fileName.c_str()); return true; } diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 3f72cd286..417385987 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -90,10 +90,6 @@ public: "if it does not exist.\n" "APPEND will write a message into a file same as WRITE, except " "it will append it to the end of the file\n" - "NOTE: When using file WRITE and file APPEND, the produced file " - "cannot be used as an input to CMake (configure_file, source file ...) " - "because it will lead to an infinite loop. Use configure_file if you " - "want to generate input files to CMake.\n" "READ will read the content of a file and store it into the " "variable. It will start at the given offset and read up to numBytes. " "If the argument HEX is given, the binary data will be converted to " diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index cf9d0a9d3..b5893327c 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -912,7 +912,6 @@ void cmGlobalGenerator::CheckLocalGenerators() } this->CMakeInstance->UpdateProgress ("Configuring", 0.9f+0.1f*(i+1.0f)/this->LocalGenerators.size()); - this->LocalGenerators[i]->GetMakefile()->CheckInfiniteLoops(); } if(notFoundMap.size()) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4cd9d0a9c..bc60955bb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2796,33 +2796,6 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, return res; } -void cmMakefile::AddWrittenFile(const char* file) -{ this->GetCMakeInstance()->AddWrittenFile(file); } - -bool cmMakefile::HasWrittenFile(const char* file) -{ return this->GetCMakeInstance()->HasWrittenFile(file); } - -bool cmMakefile::CheckInfiniteLoops() -{ - std::vector::iterator it; - for ( it = this->ListFiles.begin(); - it != this->ListFiles.end(); - ++ it ) - { - if ( this->HasWrittenFile(it->c_str()) ) - { - cmOStringStream str; - str << "File " << it->c_str() << - " is written by WRITE_FILE (or FILE WRITE) command and should " - "not be used as input to CMake. Please use CONFIGURE_FILE to " - "be safe. Refer to the note next to FILE WRITE command."; - cmSystemTools::Error(str.str().c_str()); - return false; - } - } - return true; -} - void cmMakefile::SetProperty(const char* prop, const char* value) { if (!prop) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d8873f4c6..4f54f7134 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -93,18 +93,6 @@ public: { this->FunctionBlockers.remove(fb);} void RemoveFunctionBlocker(const cmListFileFunction& lff); - /** - * Add file to the written file list. These file should not be in the list - * of dependencies because they cause infinite loops. - */ - void AddWrittenFile(const char* file); - bool HasWrittenFile(const char* file); - - /** - * Check if there are any infinite loops - */ - bool CheckInfiniteLoops(); - /** * Try running cmake and building a file. This is used for dynalically * loaded commands, not as part of the usual build process. diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index 8afd7586a..2fba5081c 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -97,7 +97,6 @@ bool cmWriteFileCommand file << message << std::endl; file.close(); cmSystemTools::SetPermissions(fileName.c_str(), mode); - this->Makefile->AddWrittenFile(fileName.c_str()); return true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5e5859b3b..08fbe9da6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2081,8 +2081,6 @@ int cmake::ActualConfigure() this->GlobalGenerator->ClearEnabledLanguages(); } - this->CleanupWrittenFiles(); - // Truncate log files if (!this->InTryCompile) { @@ -2533,21 +2531,6 @@ void cmake::GetGeneratorDocumentation(std::vector& v) } } -void cmake::AddWrittenFile(const char* file) -{ - this->WrittenFiles.insert(file); -} - -bool cmake::HasWrittenFile(const char* file) -{ - return this->WrittenFiles.find(file) != this->WrittenFiles.end(); -} - -void cmake::CleanupWrittenFiles() -{ - this->WrittenFiles.clear(); -} - void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: diff --git a/Source/cmake.h b/Source/cmake.h index c1e9a728b..8dd5ad12b 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -294,11 +294,6 @@ class cmake bool GetDebugTryCompile(){return this->DebugTryCompile;} void DebugTryCompileOn(){this->DebugTryCompile = true;} - ///! Get the list of files written by CMake using FILE(WRITE / WRITE_FILE - void AddWrittenFile(const char* file); - bool HasWrittenFile(const char* file); - void CleanupWrittenFiles(); - /** * Generate CMAKE_ROOT and CMAKE_COMMAND cache entries */ @@ -389,7 +384,6 @@ protected: std::string StartOutputDirectory; bool SuppressDevWarnings; bool DoSuppressDevWarnings; - std::set WrittenFiles; ///! return true if the same cmake was used to make the cache. bool CacheVersionMatches();