|  | @@ -153,6 +153,7 @@ public:
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    static bool IsMinGW() { return UsingMinGW; }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  public:
 | 
	
		
			
				|  |  |    /// Default constructor.
 | 
	
		
			
				|  |  |    cmGlobalNinjaGenerator();
 | 
	
	
		
			
				|  | @@ -216,12 +217,12 @@ public:
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    virtual const char* GetCleanTargetName()         const { return "clean"; }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -public:
 | 
	
		
			
				|  |  | -  cmGeneratedFileStream* GetBuildFileStream() const
 | 
	
		
			
				|  |  | -  { return this->BuildFileStream; }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  cmGeneratedFileStream* GetRulesFileStream() const
 | 
	
		
			
				|  |  | -  { return this->RulesFileStream; }
 | 
	
		
			
				|  |  | +  cmGeneratedFileStream* GetBuildFileStream() const {
 | 
	
		
			
				|  |  | +    return this->BuildFileStream; }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  cmGeneratedFileStream* GetRulesFileStream() const {
 | 
	
		
			
				|  |  | +    return this->RulesFileStream; }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    void AddCXXCompileCommand(const std::string &commandLine,
 | 
	
		
			
				|  |  |                              const std::string &sourceFile);
 | 
	
	
		
			
				|  | @@ -246,27 +247,63 @@ public:
 | 
	
		
			
				|  |  |    void AddCustomCommandRule();
 | 
	
		
			
				|  |  |    void AddMacOSXContentRule();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +  bool HasCustomCommandOutput(const std::string &output) {
 | 
	
		
			
				|  |  | +    return this->CustomCommandOutputs.find(output) !=
 | 
	
		
			
				|  |  | +           this->CustomCommandOutputs.end();
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  /// Called when we have seen the given custom command.  Returns true
 | 
	
		
			
				|  |  | +  /// if we has seen it before.
 | 
	
		
			
				|  |  | +  bool SeenCustomCommand(cmCustomCommand const *cc) {
 | 
	
		
			
				|  |  | +    return !this->CustomCommands.insert(cc).second;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  /// Called when we have seen the given custom command output.
 | 
	
		
			
				|  |  | +  void SeenCustomCommandOutput(const std::string &output) {
 | 
	
		
			
				|  |  | +    this->CustomCommandOutputs.insert(output);
 | 
	
		
			
				|  |  | +    // We don't need the assumed dependencies anymore, because we have
 | 
	
		
			
				|  |  | +    // an output.
 | 
	
		
			
				|  |  | +    this->AssumedSourceDependencies.erase(output);
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  void AddAssumedSourceDependencies(const std::string &source,
 | 
	
		
			
				|  |  | +                                    const cmNinjaDeps &deps) {
 | 
	
		
			
				|  |  | +    std::set<std::string> &ASD = this->AssumedSourceDependencies[source];
 | 
	
		
			
				|  |  | +    // Because we may see the same source file multiple times (same source
 | 
	
		
			
				|  |  | +    // specified in multiple targets), compute the union of any assumed
 | 
	
		
			
				|  |  | +    // dependencies.
 | 
	
		
			
				|  |  | +    ASD.insert(deps.begin(), deps.end());
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  void AppendTargetOutputs(cmTarget* target, cmNinjaDeps& outputs);
 | 
	
		
			
				|  |  | +  void AppendTargetDepends(cmTarget* target, cmNinjaDeps& outputs);
 | 
	
		
			
				|  |  | +  void AddDependencyToAll(cmTarget* target);
 | 
	
		
			
				|  |  | +  void AddDependencyToAll(const std::string& input);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  const std::vector<cmLocalGenerator*>& GetLocalGenerators() const {
 | 
	
		
			
				|  |  | +    return LocalGenerators; }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  bool IsExcluded(cmLocalGenerator* root, cmTarget& target) {
 | 
	
		
			
				|  |  | +    return cmGlobalGenerator::IsExcluded(root, target); }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  int GetRuleCmdLength(const std::string& name) {
 | 
	
		
			
				|  |  | +    return RuleCmdLength[name]; }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  void AddTargetAlias(const std::string& alias, cmTarget* target);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  protected:
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /// Overloaded methods.
 | 
	
		
			
				|  |  |    /// @see cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS()
 | 
	
		
			
				|  |  |    virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() { return true; }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  private:
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /// @see cmGlobalGenerator::ComputeTargetObjects
 | 
	
		
			
				|  |  |    virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -private:
 | 
	
		
			
				|  |  | -  // In order to access the AddDependencyToAll() functions and co.
 | 
	
		
			
				|  |  | -  friend class cmLocalNinjaGenerator;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  // In order to access the SeenCustomCommand() function.
 | 
	
		
			
				|  |  | -  friend class cmNinjaTargetGenerator;
 | 
	
		
			
				|  |  | -  friend class cmNinjaNormalTargetGenerator;
 | 
	
		
			
				|  |  | -  friend class cmNinjaUtilityTargetGenerator;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -private:
 | 
	
		
			
				|  |  |    void OpenBuildFileStream();
 | 
	
		
			
				|  |  |    void CloseBuildFileStream();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -278,15 +315,8 @@ private:
 | 
	
		
			
				|  |  |    /// Write the common disclaimer text at the top of each build file.
 | 
	
		
			
				|  |  |    void WriteDisclaimer(std::ostream& os);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  void AddDependencyToAll(cmTarget* target);
 | 
	
		
			
				|  |  | -  void AddDependencyToAll(const std::string& input);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    void WriteAssumedSourceDependencies();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  void AppendTargetOutputs(cmTarget* target, cmNinjaDeps& outputs);
 | 
	
		
			
				|  |  | -  void AppendTargetDepends(cmTarget* target, cmNinjaDeps& outputs);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  void AddTargetAlias(const std::string& alias, cmTarget* target);
 | 
	
		
			
				|  |  |    void WriteTargetAliases(std::ostream& os);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    void WriteBuiltinTargets(std::ostream& os);
 | 
	
	
		
			
				|  | @@ -295,39 +325,9 @@ private:
 | 
	
		
			
				|  |  |    void WriteTargetClean(std::ostream& os);
 | 
	
		
			
				|  |  |    void WriteTargetHelp(std::ostream& os);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  /// Called when we have seen the given custom command.  Returns true
 | 
	
		
			
				|  |  | -  /// if we has seen it before.
 | 
	
		
			
				|  |  | -  bool SeenCustomCommand(cmCustomCommand const *cc) {
 | 
	
		
			
				|  |  | -    return !this->CustomCommands.insert(cc).second;
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  /// Called when we have seen the given custom command output.
 | 
	
		
			
				|  |  | -  void SeenCustomCommandOutput(const std::string &output) {
 | 
	
		
			
				|  |  | -    this->CustomCommandOutputs.insert(output);
 | 
	
		
			
				|  |  | -    // We don't need the assumed dependencies anymore, because we have
 | 
	
		
			
				|  |  | -    // an output.
 | 
	
		
			
				|  |  | -    this->AssumedSourceDependencies.erase(output);
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  bool HasCustomCommandOutput(const std::string &output) {
 | 
	
		
			
				|  |  | -    return this->CustomCommandOutputs.find(output) !=
 | 
	
		
			
				|  |  | -           this->CustomCommandOutputs.end();
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  void AddAssumedSourceDependencies(const std::string &source,
 | 
	
		
			
				|  |  | -                                    const cmNinjaDeps &deps) {
 | 
	
		
			
				|  |  | -    std::set<std::string> &ASD = this->AssumedSourceDependencies[source];
 | 
	
		
			
				|  |  | -    // Because we may see the same source file multiple times (same source
 | 
	
		
			
				|  |  | -    // specified in multiple targets), compute the union of any assumed
 | 
	
		
			
				|  |  | -    // dependencies.
 | 
	
		
			
				|  |  | -    ASD.insert(deps.begin(), deps.end());
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    std::string ninjaCmd() const;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  int GetRuleCmdLength(const std::string& name) { return RuleCmdLength[name]; }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -private:
 | 
	
		
			
				|  |  |    /// The file containing the build statement. (the relation ship of the
 | 
	
		
			
				|  |  |    /// compilation DAG).
 | 
	
		
			
				|  |  |    cmGeneratedFileStream* BuildFileStream;
 |