\class cmGlobalGenerator * \brief Responsible for overseeing the generation process for the entire tree * * Subclasses of this class generate makefiles for various * platforms. */
| 107 | * platforms. |
| 108 | */ |
| 109 | class cmGlobalGenerator |
| 110 | { |
| 111 | public: |
| 112 | using LocalGeneratorVector = std::vector<std::unique_ptr<cmLocalGenerator>>; |
| 113 | enum class BuildTryCompile |
| 114 | { |
| 115 | No, |
| 116 | Yes, |
| 117 | }; |
| 118 | |
| 119 | //! Free any memory allocated with the GlobalGenerator |
| 120 | cmGlobalGenerator(cmake* cm); |
| 121 | virtual ~cmGlobalGenerator(); |
| 122 | |
| 123 | virtual std::unique_ptr<cmLocalGenerator> CreateLocalGenerator( |
| 124 | cmMakefile* mf); |
| 125 | |
| 126 | //! Get the name for this generator |
| 127 | virtual std::string GetName() const { return "Generic"; } |
| 128 | |
| 129 | /** Check whether the given name matches the current generator. */ |
| 130 | virtual bool MatchesGeneratorName(std::string const& name) const |
| 131 | { |
| 132 | return this->GetName() == name; |
| 133 | } |
| 134 | |
| 135 | /** Get encoding used by generator for makefile files */ |
| 136 | virtual codecvt_Encoding GetMakefileEncoding() const; |
| 137 | |
| 138 | #if !defined(CMAKE_BOOTSTRAP) |
| 139 | /** Get a JSON object describing the generator. */ |
| 140 | virtual Json::Value GetJson() const; |
| 141 | #endif |
| 142 | |
| 143 | /** Tell the generator about the target system. */ |
| 144 | virtual bool SetSystemName(std::string const&, cmMakefile*) { return true; } |
| 145 | |
| 146 | /** Set the generator-specific instance. Returns true if supported. */ |
| 147 | virtual bool SetGeneratorInstance(std::string const& i, cmMakefile* mf); |
| 148 | |
| 149 | /** Set the generator-specific platform name. Returns true if platform |
| 150 | is supported and false otherwise. */ |
| 151 | virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf); |
| 152 | |
| 153 | /** Set the generator-specific toolset name. Returns true if toolset |
| 154 | is supported and false otherwise. */ |
| 155 | virtual bool SetGeneratorToolset(std::string const& ts, bool build, |
| 156 | cmMakefile* mf); |
| 157 | |
| 158 | /** Read any other cache entries needed for cmake --build. */ |
| 159 | virtual bool ReadCacheEntriesForBuild(cmState const& /*state*/) |
| 160 | { |
| 161 | return true; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Create LocalGenerators and process the CMakeLists files. This does not |
| 166 | * actually produce any makefiles, DSPs, etc. |
nothing calls this directly
no test coverage detected
searching dependent graphs…