From cf7f03e5229aa011e176589fbc71cf4fb259f897 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 16 May 2015 05:20:36 +0200 Subject: [PATCH] cmGlobalUnixMakefileGenerator3: Host the DefineWindowsNULL. --- Source/cmGlobalBorlandMakefileGenerator.cxx | 2 +- Source/cmGlobalJOMMakefileGenerator.cxx | 2 +- Source/cmGlobalNMakeMakefileGenerator.cxx | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 1 + Source/cmGlobalUnixMakefileGenerator3.h | 1 + Source/cmGlobalWatcomWMakeGenerator.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 5 +++-- Source/cmLocalUnixMakefileGenerator3.h | 8 -------- 8 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index ab878fe53..b0adb95e7 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/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); diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index 25613eb77..35d20ed5c 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/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); diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 98d7fb46e..c059ba0e1 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/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); diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 32523de55..fd9b85129 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -35,6 +35,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3() this->CommandDatabase = NULL; this->IncludeDirective = "include"; + this->DefineWindowsNULL = false; } void cmGlobalUnixMakefileGenerator3 diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 950a4469b..ffe65a0bb 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -134,6 +134,7 @@ public: virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const; std::string IncludeDirective; + bool DefineWindowsNULL; protected: void WriteMainMakefile2(); void WriteMainCMakefile(); diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index fcc754a8d..10a8d190c 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/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); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 3db04339d..39b35a40b 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/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(this->GlobalGenerator); + if(gg->DefineWindowsNULL) { makefileStream << "!IF \"$(OS)\" == \"Windows_NT\"\n" diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 492f5d3f4..37a926592 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/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;