[Cmake-commits] CMake branch, next, updated. v2.8.8-3517-g83459d6
Peter Kuemmel
syntheticpp at gmx.net
Wed Jul 18 06:31:21 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 83459d6569d903c4c8fc84ebcd6584d4c5ac7a2c (commit)
via 44ba4cfdb6471506db37634b032cf4fa3784f4f9 (commit)
via 7751966297e3b68b6c9904300f96bb57882af11a (commit)
from 046d146d0a6102abbf2471ac5ad77280c30518e2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83459d6569d903c4c8fc84ebcd6584d4c5ac7a2c
commit 83459d6569d903c4c8fc84ebcd6584d4c5ac7a2c
Merge: 046d146 44ba4cf
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Wed Jul 18 06:31:15 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 18 06:31:15 2012 -0400
Merge topic 'ninja-fix-macosx' into next
44ba4cf Ninja: remove warnings
7751966 Ninja: remove 'friend' in ninja code
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44ba4cfdb6471506db37634b032cf4fa3784f4f9
commit 44ba4cfdb6471506db37634b032cf4fa3784f4f9
Author: Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Wed Jul 18 12:17:39 2012 +0200
Commit: Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Wed Jul 18 12:17:39 2012 +0200
Ninja: remove warnings
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index bc016dc..0de182e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -29,7 +29,7 @@
cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
: OSXBundleGenerator(0)
- , MacOSXContentGenerator(this)
+ , MacOSXContentGenerator(0)
{
this->BuildFileStream = 0;
this->InfoFileStream = 0;
@@ -52,6 +52,12 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
{
this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
}
+ MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
+}
+
+cmMakefileTargetGenerator::~cmMakefileTargetGenerator()
+{
+ delete MacOSXContentGenerator;
}
cmMakefileTargetGenerator *
@@ -157,10 +163,10 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
}
this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->HeaderSources,
- &this->MacOSXContentGenerator);
+ this->MacOSXContentGenerator);
this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->ExtraSources,
- &this->MacOSXContentGenerator);
+ this->MacOSXContentGenerator);
for(std::vector<cmSourceFile*>::const_iterator
si = this->GeneratorTarget->ExternalObjects.begin();
si != this->GeneratorTarget->ExternalObjects.end(); ++si)
@@ -348,13 +354,6 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
}
}
-//----------------------------------------------------------------------------
-cmMakefileTargetGenerator::MacOSXContentGeneratorType::
-MacOSXContentGeneratorType(cmMakefileTargetGenerator* generator)
- : cmOSXBundleGenerator::MacOSXContentGeneratorType()
- , Generator(generator)
-{
-}
//----------------------------------------------------------------------------
void
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index d5eb634..3ea524b 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -35,7 +35,7 @@ class cmMakefileTargetGenerator
public:
// constructor to set the ivars
cmMakefileTargetGenerator(cmTarget* target);
- virtual ~cmMakefileTargetGenerator() {};
+ virtual ~cmMakefileTargetGenerator();
// construct using this factory call
static cmMakefileTargetGenerator *New(cmTarget *tgt);
@@ -74,17 +74,17 @@ protected:
void WriteTargetDependRules();
// write rules for Mac OS X Application Bundle content.
- class MacOSXContentGeneratorType
- : public cmOSXBundleGenerator::MacOSXContentGeneratorType
+ struct MacOSXContentGeneratorType :
+ cmOSXBundleGenerator::MacOSXContentGeneratorType
{
- public:
- MacOSXContentGeneratorType(cmMakefileTargetGenerator* Generator);
- virtual void operator()(cmSourceFile& source, const char* pkgloc);
+ MacOSXContentGeneratorType(cmMakefileTargetGenerator* gen) :
+ Generator(gen) {}
+
+ void operator()(cmSourceFile& source, const char* pkgloc);
private:
cmMakefileTargetGenerator* Generator;
};
- friend class MacOSXContentGeneratorType;
// write the rules for an object
void WriteObjectRuleFiles(cmSourceFile& source);
@@ -234,7 +234,7 @@ protected:
std::string MacContentDirectory;
std::set<cmStdString> MacContentFolders;
cmOSXBundleGenerator* OSXBundleGenerator;
- MacOSXContentGeneratorType MacOSXContentGenerator;
+ MacOSXContentGeneratorType* MacOSXContentGenerator;
typedef std::map<cmStdString, cmStdString> ByLanguageMap;
std::string GetFlags(const std::string &l);
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index ac2b468..967507e 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -57,7 +57,7 @@ cmNinjaTargetGenerator::New(cmTarget* target)
cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target)
:
- MacOSXContentGenerator(this),
+ MacOSXContentGenerator(0),
OSXBundleGenerator(0),
MacContentFolders(),
Target(target),
@@ -68,10 +68,12 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target)
{
this->GeneratorTarget =
this->GetGlobalGenerator()->GetGeneratorTarget(target);
+ MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
}
cmNinjaTargetGenerator::~cmNinjaTargetGenerator()
{
+ delete MacOSXContentGenerator;
}
cmGeneratedFileStream& cmNinjaTargetGenerator::GetBuildFileStream() const
@@ -434,10 +436,10 @@ cmNinjaTargetGenerator
}
this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->HeaderSources,
- &this->MacOSXContentGenerator);
+ this->MacOSXContentGenerator);
this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->ExtraSources,
- &this->MacOSXContentGenerator);
+ this->MacOSXContentGenerator);
for(std::vector<cmSourceFile*>::const_iterator
si = this->GeneratorTarget->ExternalObjects.begin();
si != this->GeneratorTarget->ExternalObjects.end(); ++si)
@@ -645,13 +647,6 @@ cmNinjaTargetGenerator
EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
}
-//----------------------------------------------------------------------------
-cmNinjaTargetGenerator::MacOSXContentGeneratorType::
-MacOSXContentGeneratorType(cmNinjaTargetGenerator* generator)
- : cmOSXBundleGenerator::MacOSXContentGeneratorType()
- , Generator(generator)
-{
-}
//----------------------------------------------------------------------------
void
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index a2ca4bd..fb45837 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -116,12 +116,13 @@ protected:
void EnsureParentDirectoryExists(const std::string& path);
// write rules for Mac OS X Application Bundle content.
- class MacOSXContentGeneratorType
- : public cmOSXBundleGenerator::MacOSXContentGeneratorType
+ struct MacOSXContentGeneratorType :
+ cmOSXBundleGenerator::MacOSXContentGeneratorType
{
- public:
- MacOSXContentGeneratorType(cmNinjaTargetGenerator* Generator);
- virtual void operator()(cmSourceFile& source, const char* pkgloc);
+ MacOSXContentGeneratorType(cmNinjaTargetGenerator* g) :
+ Generator(g) {}
+
+ void operator()(cmSourceFile& source, const char* pkgloc);
private:
cmNinjaTargetGenerator* Generator;
@@ -129,7 +130,7 @@ protected:
protected:
- MacOSXContentGeneratorType MacOSXContentGenerator;
+ MacOSXContentGeneratorType* MacOSXContentGenerator;
// Properly initialized by sub-classes.
cmOSXBundleGenerator* OSXBundleGenerator;
std::set<cmStdString> MacContentFolders;
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index 2ed9e91..01e3cbe 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -35,9 +35,9 @@ public:
void CreateFramework(std::string const& targetName);
void CreateCFBundle(std::string& targetName, std::string& outpath);
- class MacOSXContentGeneratorType
+ struct MacOSXContentGeneratorType
{
- public:
+ virtual ~MacOSXContentGeneratorType() {}
virtual void operator()(cmSourceFile& source, const char* pkgloc) = 0;
};
@@ -67,4 +67,5 @@ private:
std::set<cmStdString>* MacContentFolders;
};
+
#endif
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7751966297e3b68b6c9904300f96bb57882af11a
commit 7751966297e3b68b6c9904300f96bb57882af11a
Author: Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Wed Jul 18 11:27:49 2012 +0200
Commit: Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Wed Jul 18 11:27:49 2012 +0200
Ninja: remove 'friend' in ninja code
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 61353c5..b2fe243 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -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;
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index ea9c406..d902f4e 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -61,7 +61,7 @@ void cmLocalNinjaGenerator::Generate()
tg->Generate();
// Add the target to "all" if required.
if (!this->GetGlobalNinjaGenerator()->IsExcluded(
- this->GetGlobalNinjaGenerator()->LocalGenerators[0],
+ this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
t->second))
this->GetGlobalNinjaGenerator()->AddDependencyToAll(&t->second);
delete tg;
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index ea44b2f..20b36e8 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -45,7 +45,6 @@ public:
/// Overloaded methods. @see cmLocalGenerator::GetTargetDirectory()
virtual std::string GetTargetDirectory(cmTarget const& target) const;
-public:
const cmGlobalNinjaGenerator* GetGlobalNinjaGenerator() const;
cmGlobalNinjaGenerator* GetGlobalNinjaGenerator();
@@ -67,33 +66,8 @@ public:
std::string GetHomeRelativeOutputPath() const
{ return this->HomeRelativeOutputPath; }
-protected:
- virtual std::string ConvertToLinkReference(std::string const& lib);
- virtual std::string ConvertToIncludeReference(std::string const& path);
-
-private:
- friend class cmGlobalNinjaGenerator;
-
- // In order to access to protected member of the local generator.
- friend class cmNinjaTargetGenerator;
- friend class cmNinjaNormalTargetGenerator;
- friend class cmNinjaUtilityTargetGenerator;
-
-private:
- cmGeneratedFileStream& GetBuildFileStream() const;
- cmGeneratedFileStream& GetRulesFileStream() const;
-
- void WriteBuildFileTop();
- void WriteProjectHeader(std::ostream& os);
- void WriteNinjaFilesInclusion(std::ostream& os);
- void WriteProcessedMakefile(std::ostream& os);
-
- void SetConfigName();
-
std::string ConvertToNinjaPath(const char *path);
- struct map_to_ninja_path;
- friend struct map_to_ninja_path;
struct map_to_ninja_path {
cmLocalNinjaGenerator *LocalGenerator;
map_to_ninja_path(cmLocalNinjaGenerator *LocalGen)
@@ -102,26 +76,52 @@ private:
return LocalGenerator->ConvertToNinjaPath(path.c_str());
}
};
+
map_to_ninja_path MapToNinjaPath() {
return map_to_ninja_path(this);
}
+ void ExpandRuleVariables(std::string& string,
+ const RuleVariables& replaceValues) {
+ return cmLocalGenerator::
+ ExpandRuleVariables(string, replaceValues); }
+
+ std::string BuildCommandLine(const std::vector<std::string> &cmdLines);
+
void AppendTargetOutputs(cmTarget* target, cmNinjaDeps& outputs);
void AppendTargetDepends(cmTarget* target, cmNinjaDeps& outputs);
- void AppendCustomCommandDeps(const cmCustomCommand *cc,
- cmNinjaDeps &ninjaDeps);
- std::string BuildCommandLine(const std::vector<std::string> &cmdLines);
+ void AddCustomCommandTarget(cmCustomCommand const* cc, cmTarget* target);
void AppendCustomCommandLines(const cmCustomCommand *cc,
std::vector<std::string> &cmdLines);
+ void AppendCustomCommandDeps(const cmCustomCommand *cc,
+ cmNinjaDeps &ninjaDeps);
+
+ virtual std::string ConvertToLinkReference(std::string const& lib);
+
+
+protected:
+ virtual std::string ConvertToIncludeReference(std::string const& path);
+
+
+private:
+ cmGeneratedFileStream& GetBuildFileStream() const;
+ cmGeneratedFileStream& GetRulesFileStream() const;
+
+ void WriteBuildFileTop();
+ void WriteProjectHeader(std::ostream& os);
+ void WriteNinjaFilesInclusion(std::ostream& os);
+ void WriteProcessedMakefile(std::ostream& os);
+
+ void SetConfigName();
+
void WriteCustomCommandRule();
void WriteCustomCommandBuildStatement(cmCustomCommand const *cc,
const cmNinjaDeps& orderOnlyDeps);
- void AddCustomCommandTarget(cmCustomCommand const* cc, cmTarget* target);
void WriteCustomCommandBuildStatements();
-private:
+
std::string ConfigName;
std::string HomeRelativeOutputPath;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 36eb64d..ac2b468 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -91,7 +91,7 @@ cmGlobalNinjaGenerator* cmNinjaTargetGenerator::GetGlobalGenerator() const
const char* cmNinjaTargetGenerator::GetConfigName() const
{
- return this->LocalGenerator->ConfigName.c_str();
+ return this->LocalGenerator->GetConfigName();
}
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 0a3329f..a2ca4bd 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -126,7 +126,7 @@ protected:
private:
cmNinjaTargetGenerator* Generator;
};
- friend class MacOSXContentGeneratorType;
+
protected:
MacOSXContentGeneratorType MacOSXContentGenerator;
@@ -134,6 +134,7 @@ protected:
cmOSXBundleGenerator* OSXBundleGenerator;
std::set<cmStdString> MacContentFolders;
+
private:
cmTarget* Target;
cmGeneratorTarget* GeneratorTarget;
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalNinjaGenerator.h | 104 +++++++++++++++++-----------------
Source/cmLocalNinjaGenerator.cxx | 2 +-
Source/cmLocalNinjaGenerator.h | 62 ++++++++++----------
Source/cmMakefileTargetGenerator.cxx | 19 +++---
Source/cmMakefileTargetGenerator.h | 16 +++---
Source/cmNinjaTargetGenerator.cxx | 17 ++----
Source/cmNinjaTargetGenerator.h | 16 +++--
Source/cmOSXBundleGenerator.h | 5 +-
8 files changed, 119 insertions(+), 122 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list