Ninja: remove warnings

This commit is contained in:
Peter Kümmel 2012-07-18 12:17:39 +02:00
parent 7751966297
commit 44ba4cfdb6
5 changed files with 32 additions and 36 deletions

View File

@ -29,7 +29,7 @@
cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target) cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
: OSXBundleGenerator(0) : OSXBundleGenerator(0)
, MacOSXContentGenerator(this) , MacOSXContentGenerator(0)
{ {
this->BuildFileStream = 0; this->BuildFileStream = 0;
this->InfoFileStream = 0; this->InfoFileStream = 0;
@ -52,6 +52,12 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
{ {
this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus); this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
} }
MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
}
cmMakefileTargetGenerator::~cmMakefileTargetGenerator()
{
delete MacOSXContentGenerator;
} }
cmMakefileTargetGenerator * cmMakefileTargetGenerator *
@ -157,10 +163,10 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
} }
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->HeaderSources, this->GeneratorTarget->HeaderSources,
&this->MacOSXContentGenerator); this->MacOSXContentGenerator);
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->ExtraSources, this->GeneratorTarget->ExtraSources,
&this->MacOSXContentGenerator); this->MacOSXContentGenerator);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile*>::const_iterator
si = this->GeneratorTarget->ExternalObjects.begin(); si = this->GeneratorTarget->ExternalObjects.begin();
si != this->GeneratorTarget->ExternalObjects.end(); ++si) si != this->GeneratorTarget->ExternalObjects.end(); ++si)
@ -348,13 +354,6 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
} }
} }
//----------------------------------------------------------------------------
cmMakefileTargetGenerator::MacOSXContentGeneratorType::
MacOSXContentGeneratorType(cmMakefileTargetGenerator* generator)
: cmOSXBundleGenerator::MacOSXContentGeneratorType()
, Generator(generator)
{
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void

View File

@ -35,7 +35,7 @@ class cmMakefileTargetGenerator
public: public:
// constructor to set the ivars // constructor to set the ivars
cmMakefileTargetGenerator(cmTarget* target); cmMakefileTargetGenerator(cmTarget* target);
virtual ~cmMakefileTargetGenerator() {}; virtual ~cmMakefileTargetGenerator();
// construct using this factory call // construct using this factory call
static cmMakefileTargetGenerator *New(cmTarget *tgt); static cmMakefileTargetGenerator *New(cmTarget *tgt);
@ -74,17 +74,17 @@ protected:
void WriteTargetDependRules(); void WriteTargetDependRules();
// write rules for Mac OS X Application Bundle content. // write rules for Mac OS X Application Bundle content.
class MacOSXContentGeneratorType struct MacOSXContentGeneratorType :
: public cmOSXBundleGenerator::MacOSXContentGeneratorType cmOSXBundleGenerator::MacOSXContentGeneratorType
{ {
public: MacOSXContentGeneratorType(cmMakefileTargetGenerator* gen) :
MacOSXContentGeneratorType(cmMakefileTargetGenerator* Generator); Generator(gen) {}
virtual void operator()(cmSourceFile& source, const char* pkgloc);
void operator()(cmSourceFile& source, const char* pkgloc);
private: private:
cmMakefileTargetGenerator* Generator; cmMakefileTargetGenerator* Generator;
}; };
friend class MacOSXContentGeneratorType;
// write the rules for an object // write the rules for an object
void WriteObjectRuleFiles(cmSourceFile& source); void WriteObjectRuleFiles(cmSourceFile& source);
@ -234,7 +234,7 @@ protected:
std::string MacContentDirectory; std::string MacContentDirectory;
std::set<cmStdString> MacContentFolders; std::set<cmStdString> MacContentFolders;
cmOSXBundleGenerator* OSXBundleGenerator; cmOSXBundleGenerator* OSXBundleGenerator;
MacOSXContentGeneratorType MacOSXContentGenerator; MacOSXContentGeneratorType* MacOSXContentGenerator;
typedef std::map<cmStdString, cmStdString> ByLanguageMap; typedef std::map<cmStdString, cmStdString> ByLanguageMap;
std::string GetFlags(const std::string &l); std::string GetFlags(const std::string &l);

View File

@ -57,7 +57,7 @@ cmNinjaTargetGenerator::New(cmTarget* target)
cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target) cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target)
: :
MacOSXContentGenerator(this), MacOSXContentGenerator(0),
OSXBundleGenerator(0), OSXBundleGenerator(0),
MacContentFolders(), MacContentFolders(),
Target(target), Target(target),
@ -68,10 +68,12 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target)
{ {
this->GeneratorTarget = this->GeneratorTarget =
this->GetGlobalGenerator()->GetGeneratorTarget(target); this->GetGlobalGenerator()->GetGeneratorTarget(target);
MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
} }
cmNinjaTargetGenerator::~cmNinjaTargetGenerator() cmNinjaTargetGenerator::~cmNinjaTargetGenerator()
{ {
delete MacOSXContentGenerator;
} }
cmGeneratedFileStream& cmNinjaTargetGenerator::GetBuildFileStream() const cmGeneratedFileStream& cmNinjaTargetGenerator::GetBuildFileStream() const
@ -434,10 +436,10 @@ cmNinjaTargetGenerator
} }
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->HeaderSources, this->GeneratorTarget->HeaderSources,
&this->MacOSXContentGenerator); this->MacOSXContentGenerator);
this->OSXBundleGenerator->GenerateMacOSXContentStatements( this->OSXBundleGenerator->GenerateMacOSXContentStatements(
this->GeneratorTarget->ExtraSources, this->GeneratorTarget->ExtraSources,
&this->MacOSXContentGenerator); this->MacOSXContentGenerator);
for(std::vector<cmSourceFile*>::const_iterator for(std::vector<cmSourceFile*>::const_iterator
si = this->GeneratorTarget->ExternalObjects.begin(); si = this->GeneratorTarget->ExternalObjects.begin();
si != this->GeneratorTarget->ExternalObjects.end(); ++si) si != this->GeneratorTarget->ExternalObjects.end(); ++si)
@ -645,13 +647,6 @@ cmNinjaTargetGenerator
EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str())); EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
} }
//----------------------------------------------------------------------------
cmNinjaTargetGenerator::MacOSXContentGeneratorType::
MacOSXContentGeneratorType(cmNinjaTargetGenerator* generator)
: cmOSXBundleGenerator::MacOSXContentGeneratorType()
, Generator(generator)
{
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void

View File

@ -116,12 +116,13 @@ protected:
void EnsureParentDirectoryExists(const std::string& path); void EnsureParentDirectoryExists(const std::string& path);
// write rules for Mac OS X Application Bundle content. // write rules for Mac OS X Application Bundle content.
class MacOSXContentGeneratorType struct MacOSXContentGeneratorType :
: public cmOSXBundleGenerator::MacOSXContentGeneratorType cmOSXBundleGenerator::MacOSXContentGeneratorType
{ {
public: MacOSXContentGeneratorType(cmNinjaTargetGenerator* g) :
MacOSXContentGeneratorType(cmNinjaTargetGenerator* Generator); Generator(g) {}
virtual void operator()(cmSourceFile& source, const char* pkgloc);
void operator()(cmSourceFile& source, const char* pkgloc);
private: private:
cmNinjaTargetGenerator* Generator; cmNinjaTargetGenerator* Generator;
@ -129,7 +130,7 @@ protected:
protected: protected:
MacOSXContentGeneratorType MacOSXContentGenerator; MacOSXContentGeneratorType* MacOSXContentGenerator;
// Properly initialized by sub-classes. // Properly initialized by sub-classes.
cmOSXBundleGenerator* OSXBundleGenerator; cmOSXBundleGenerator* OSXBundleGenerator;
std::set<cmStdString> MacContentFolders; std::set<cmStdString> MacContentFolders;

View File

@ -35,9 +35,9 @@ public:
void CreateFramework(std::string const& targetName); void CreateFramework(std::string const& targetName);
void CreateCFBundle(std::string& targetName, std::string& outpath); void CreateCFBundle(std::string& targetName, std::string& outpath);
class MacOSXContentGeneratorType struct MacOSXContentGeneratorType
{ {
public: virtual ~MacOSXContentGeneratorType() {}
virtual void operator()(cmSourceFile& source, const char* pkgloc) = 0; virtual void operator()(cmSourceFile& source, const char* pkgloc) = 0;
}; };
@ -67,4 +67,5 @@ private:
std::set<cmStdString>* MacContentFolders; std::set<cmStdString>* MacContentFolders;
}; };
#endif #endif