diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-10 09:54:58 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-11 13:51:30 (GMT) |
commit | 47da9859e8b5e938fa40b69d117aecef82e090a9 (patch) | |
tree | 0648f0bc72f1b2471cbed1e363be2057afeb1e4d /Source/cmGlobalNinjaGenerator.h | |
parent | 990270213408bb4d11fa620ba9c96b25da313945 (diff) | |
download | CMake-47da9859e8b5e938fa40b69d117aecef82e090a9.zip CMake-47da9859e8b5e938fa40b69d117aecef82e090a9.tar.gz CMake-47da9859e8b5e938fa40b69d117aecef82e090a9.tar.bz2 |
Ninja: In cmGlobalNinjaGenerator use std::unique_ptr to manage output streams
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.h')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 9c9cc1d..ce9d124 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -7,6 +7,7 @@ #include <iosfwd> #include <map> +#include <memory> // IWYU pragma: keep #include <set> #include <string> #include <unordered_map> @@ -14,6 +15,7 @@ #include <utility> #include <vector> +#include "cmGeneratedFileStream.h" #include "cmGlobalCommonGenerator.h" #include "cmGlobalGenerator.h" #include "cmGlobalGeneratorFactory.h" @@ -22,7 +24,6 @@ #include "cm_codecvt.hxx" class cmCustomCommand; -class cmGeneratedFileStream; class cmGeneratorTarget; class cmLinkLineComputer; class cmLocalGenerator; @@ -234,12 +235,12 @@ public: cmGeneratedFileStream* GetBuildFileStream() const { - return this->BuildFileStream; + return this->BuildFileStream.get(); } cmGeneratedFileStream* GetRulesFileStream() const { - return this->RulesFileStream; + return this->RulesFileStream.get(); } std::string const& ConvertToNinjaPath(const std::string& path) const; @@ -379,12 +380,12 @@ private: cmMakefile* mf) const override; bool CheckFortran(cmMakefile* mf) const; - void OpenBuildFileStream(); + bool OpenBuildFileStream(); void CloseBuildFileStream(); void CloseCompileCommandsStream(); - void OpenRulesFileStream(); + bool OpenRulesFileStream(); void CloseRulesFileStream(); /// Write the common disclaimer text at the top of each build file. @@ -411,11 +412,11 @@ private: /// The file containing the build statement. (the relationship of the /// compilation DAG). - cmGeneratedFileStream* BuildFileStream; + std::unique_ptr<cmGeneratedFileStream> BuildFileStream; /// The file containing the rule statements. (The action attached to each /// edge of the compilation DAG). - cmGeneratedFileStream* RulesFileStream; - cmGeneratedFileStream* CompileCommandsStream; + std::unique_ptr<cmGeneratedFileStream> RulesFileStream; + std::unique_ptr<cmGeneratedFileStream> CompileCommandsStream; /// The set of rules added to the generated build system. std::unordered_set<std::string> Rules; |