diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-01-17 20:25:08 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-01-22 15:26:21 (GMT) |
commit | 110037369d9be6c346f3de5074bb2e4d47c7e36c (patch) | |
tree | 147b87074c2a59c604ef191a07f93357af1b5b6a /Source/cmGlobalNinjaGenerator.h | |
parent | e62a3414f76d443c271f4927f6f88fad12593646 (diff) | |
download | CMake-110037369d9be6c346f3de5074bb2e4d47c7e36c.zip CMake-110037369d9be6c346f3de5074bb2e4d47c7e36c.tar.gz CMake-110037369d9be6c346f3de5074bb2e4d47c7e36c.tar.bz2 |
Refactor: Split Ninja files into impl-<Config>.ninja and build-<Config>.ninja
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.h')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 3545f1e..0410b91 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -208,12 +208,23 @@ public: } const char* GetCleanTargetName() const override { return "clean"; } + virtual cmGeneratedFileStream* GetImplFileStream( + const std::string& /*config*/) const + { + return this->BuildFileStream.get(); + } + virtual cmGeneratedFileStream* GetConfigFileStream( const std::string& /*config*/) const { return this->BuildFileStream.get(); } + virtual cmGeneratedFileStream* GetDefaultFileStream() const + { + return this->BuildFileStream.get(); + } + virtual cmGeneratedFileStream* GetCommonFileStream() const { return this->BuildFileStream.get(); @@ -397,6 +408,8 @@ public: bool EnableCrossConfigBuild() const; + virtual const char* GetDefaultBuildType() const { return nullptr; } + protected: void Generate() override; @@ -404,7 +417,6 @@ protected: virtual bool OpenBuildFileStreams(); virtual void CloseBuildFileStreams(); - virtual bool WriteDefaultBuildFile() { return true; } bool OpenFileStream(std::unique_ptr<cmGeneratedFileStream>& stream, const std::string& name); @@ -573,12 +585,23 @@ public: std::string ExpandCFGIntDir(const std::string& str, const std::string& config) const override; + cmGeneratedFileStream* GetImplFileStream( + const std::string& config) const override + { + return this->ImplFileStreams.at(config).get(); + } + cmGeneratedFileStream* GetConfigFileStream( const std::string& config) const override { return this->ConfigFileStreams.at(config).get(); } + cmGeneratedFileStream* GetDefaultFileStream() const override + { + return this->DefaultFileStream.get(); + } + cmGeneratedFileStream* GetCommonFileStream() const override { return this->CommonFileStream.get(); @@ -587,13 +610,14 @@ public: void AppendNinjaFileArgument(GeneratedMakeCommand& command, const std::string& config) const override; - static std::string GetNinjaFilename(const std::string& config); + static std::string GetNinjaImplFilename(const std::string& config); + static std::string GetNinjaConfigFilename(const std::string& config); void AddRebuildManifestOutputs(cmNinjaDeps& outputs) const override; void GetQtAutoGenConfigs(std::vector<std::string>& configs) const override; - bool WriteDefaultBuildFile() override; + const char* GetDefaultBuildType() const override; protected: bool OpenBuildFileStreams() override; @@ -601,8 +625,11 @@ protected: private: std::map<std::string, std::unique_ptr<cmGeneratedFileStream>> + ImplFileStreams; + std::map<std::string, std::unique_ptr<cmGeneratedFileStream>> ConfigFileStreams; std::unique_ptr<cmGeneratedFileStream> CommonFileStream; + std::unique_ptr<cmGeneratedFileStream> DefaultFileStream; }; #endif // ! cmGlobalNinjaGenerator_h |