Browse Source

cmGlobalUnixMakefileGenerator3: Host the DefineWindowsNULL.

Stephen Kelly 10 years ago
parent
commit
cf7f03e522

+ 1 - 1
Source/cmGlobalBorlandMakefileGenerator.cxx

@@ -23,6 +23,7 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
   this->UseLinkScript = false;
   this->WindowsShell = true;
   this->IncludeDirective = "!include";
+  this->DefineWindowsNULL = true;
 }
 
 
@@ -44,7 +45,6 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator(
 {
   cmLocalUnixMakefileGenerator3* lg =
       new cmLocalUnixMakefileGenerator3(this, parent);
-  lg->SetDefineWindowsNULL(true);
   lg->SetMakefileVariableSize(32);
   lg->SetPassMakeflags(true);
   lg->SetUnixCD(false);

+ 1 - 1
Source/cmGlobalJOMMakefileGenerator.cxx

@@ -21,6 +21,7 @@ cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator()
   this->UseLinkScript = false;
   this->WindowsShell = true;
   this->NMake = true;
+  this->DefineWindowsNULL = true;
 }
 
 void cmGlobalJOMMakefileGenerator
@@ -52,7 +53,6 @@ cmGlobalJOMMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
 {
   cmLocalUnixMakefileGenerator3* lg
       = new cmLocalUnixMakefileGenerator3(this, parent);
-  lg->SetDefineWindowsNULL(true);
   lg->SetMakeSilentFlag("/nologo");
   lg->SetIgnoreLibPrefix(true);
   lg->SetPassMakeflags(true);

+ 1 - 1
Source/cmGlobalNMakeMakefileGenerator.cxx

@@ -21,6 +21,7 @@ cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator()
   this->UseLinkScript = false;
   this->WindowsShell = true;
   this->NMake = true;
+  this->DefineWindowsNULL = true;
 }
 
 void cmGlobalNMakeMakefileGenerator
@@ -52,7 +53,6 @@ cmGlobalNMakeMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
 {
   cmLocalUnixMakefileGenerator3* lg =
       new cmLocalUnixMakefileGenerator3(this, parent);
-  lg->SetDefineWindowsNULL(true);
   lg->SetMakeSilentFlag("/nologo");
   lg->SetIgnoreLibPrefix(true);
   lg->SetPassMakeflags(true);

+ 1 - 0
Source/cmGlobalUnixMakefileGenerator3.cxx

@@ -35,6 +35,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3()
   this->CommandDatabase = NULL;
 
   this->IncludeDirective = "include";
+  this->DefineWindowsNULL = false;
 }
 
 void cmGlobalUnixMakefileGenerator3

+ 1 - 0
Source/cmGlobalUnixMakefileGenerator3.h

@@ -134,6 +134,7 @@ public:
   virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
 
   std::string IncludeDirective;
+  bool DefineWindowsNULL;
 protected:
   void WriteMainMakefile2();
   void WriteMainCMakefile();

+ 1 - 1
Source/cmGlobalWatcomWMakeGenerator.cxx

@@ -27,6 +27,7 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator()
 #endif
   this->WatcomWMake = true;
   this->IncludeDirective = "!include";
+  this->DefineWindowsNULL = true;
 }
 
 void cmGlobalWatcomWMakeGenerator
@@ -51,7 +52,6 @@ cmGlobalWatcomWMakeGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
 {
   cmLocalUnixMakefileGenerator3* lg
       = new cmLocalUnixMakefileGenerator3(this, parent);
-  lg->SetDefineWindowsNULL(true);
   lg->SetMakeSilentFlag("-h");
   lg->SetIgnoreLibPrefix(true);
   lg->SetPassMakeflags(false);

+ 3 - 2
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -86,7 +86,6 @@ cmLocalUnixMakefileGenerator3(cmGlobalGenerator* gg, cmLocalGenerator* parent)
   this->MakefileVariableSize = 0;
   this->IgnoreLibPrefix = false;
   this->PassMakeflags = false;
-  this->DefineWindowsNULL = false;
   this->UnixCD = true;
   this->ColorMakefile = false;
   this->SkipPreprocessedSourceRules = false;
@@ -719,7 +718,9 @@ cmLocalUnixMakefileGenerator3
   makefileStream
     << "# Set environment variables for the build.\n"
     << "\n";
-  if(this->DefineWindowsNULL)
+  cmGlobalUnixMakefileGenerator3* gg =
+    static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
+  if(gg->DefineWindowsNULL)
     {
     makefileStream
       << "!IF \"$(OS)\" == \"Windows_NT\"\n"

+ 0 - 8
Source/cmLocalUnixMakefileGenerator3.h

@@ -80,13 +80,6 @@ public:
   void SetMakeSilentFlag(const std::string& s) { this->MakeSilentFlag = s; }
   std::string &GetMakeSilentFlag() { return this->MakeSilentFlag; }
 
-  /**
-   * If set to true, then NULL is set to nil for non Windows_NT.
-   * This uses make syntax used by nmake and borland.
-   * The default is false.
-   */
-  void SetDefineWindowsNULL(bool v)  {this->DefineWindowsNULL = v;}
-
   /**
    * If set to true, cd dir && command is used to
    * run commands in a different directory.
@@ -297,7 +290,6 @@ private:
   int MakefileVariableSize;
   std::string MakeSilentFlag;
   std::string ConfigurationName;
-  bool DefineWindowsNULL;
   bool UnixCD;
   bool PassMakeflags;
   bool MakeCommandEscapeTargetTwice;