diff options
author | David Cole <david.cole@kitware.com> | 2012-07-24 21:03:46 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-07-24 21:03:46 (GMT) |
commit | a51e1529e79ef46c8f7f346328c788a4e630e474 (patch) | |
tree | 7fed8476e05fe1278f09a130cdf2080c12762c42 /Source/cmGlobalNinjaGenerator.h | |
parent | c1bbdbff57651a24fd8d7d5abe67dd24e7e6ed27 (diff) | |
parent | 1fc8df9ca22c23f42afa94a949918cda008b07ce (diff) | |
download | CMake-a51e1529e79ef46c8f7f346328c788a4e630e474.zip CMake-a51e1529e79ef46c8f7f346328c788a4e630e474.tar.gz CMake-a51e1529e79ef46c8f7f346328c788a4e630e474.tar.bz2 |
Merge topic 'ninja-fix-macosx'
1fc8df9 Add missing this->.
7a3ecf5 Fix memory leak in Makefile generator.
9f7dc83 Ninja: also bootstrap ninja files
5d365b2 Ninja: enable ninja support everywhere
d569f3e Ninja: void function can't return a value
52160bf Ninja: enable ninja on Mac so all Mac CDash-builds are tested, cleanup later
56aeac6 Ninja: fixes for bcc
7a6bc9e Ninja: remove 'this' from member initializer list
44ba4cf Ninja: remove warnings
7751966 Ninja: remove 'friend' in ninja code
c3988ee Re-factor OS X content generator start up.
f8e0a51 Re-factor framework directory computation.
f36c7b0 Re-factor Mac OS X content directory computation.
5d885db Re-factor bundle content copying rules generation.
3b2a01e Ninja: Use same echo message as makefiles.
7bb56c5 Re-factor CFBundle generation.
...
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.h')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 106 |
1 files changed, 55 insertions, 51 deletions
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index ff4f85d..b2fe243 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -103,6 +103,8 @@ public: const cmNinjaDeps& outputs, const cmNinjaDeps& deps = cmNinjaDeps(), const cmNinjaDeps& orderOnlyDeps = cmNinjaDeps()); + void WriteMacOSXContentBuild(const std::string& input, + const std::string& output); /** * Write a rule statement named @a name to @a os with the @a comment, @@ -151,6 +153,7 @@ public: static bool IsMinGW() { return UsingMinGW; } + public: /// Default constructor. cmGlobalNinjaGenerator(); @@ -214,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); @@ -242,6 +245,52 @@ public: bool HasRule(const std::string& name); 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: @@ -249,21 +298,12 @@ protected: /// @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(); @@ -275,14 +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 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); @@ -291,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; |