From 84e0776e77e625ab43c1a5b2031a06a035ae0210 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 13 Oct 2015 21:45:02 +0200 Subject: cmMakefile: Set default internal definitions directly. The usage tracking of cmMakefile::AddDefinition is not needed. --- Source/cmMakefile.cxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a258536..eea9d67 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -50,7 +50,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, { this->IsSourceFileTryCompile = false; - // Initialize these first since AddDefaultDefinitions calls AddDefinition this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused(); this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars(); @@ -3171,36 +3170,37 @@ void cmMakefile::AddDefaultDefinitions() will be reset in CMakeSystemSpecificInformation.cmake before the platform files are executed. */ #if defined(_WIN32) - this->AddDefinition("WIN32", "1"); - this->AddDefinition("CMAKE_HOST_WIN32", "1"); + this->StateSnapshot.SetDefinition("WIN32", "1"); + this->StateSnapshot.SetDefinition("CMAKE_HOST_WIN32", "1"); #else - this->AddDefinition("UNIX", "1"); - this->AddDefinition("CMAKE_HOST_UNIX", "1"); + this->StateSnapshot.SetDefinition("UNIX", "1"); + this->StateSnapshot.SetDefinition("CMAKE_HOST_UNIX", "1"); #endif #if defined(__CYGWIN__) if(cmSystemTools::IsOn(cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32"))) { - this->AddDefinition("WIN32", "1"); - this->AddDefinition("CMAKE_HOST_WIN32", "1"); + this->StateSnapshot.SetDefinition("WIN32", "1"); + this->StateSnapshot.SetDefinition("CMAKE_HOST_WIN32", "1"); } #endif #if defined(__APPLE__) - this->AddDefinition("APPLE", "1"); - this->AddDefinition("CMAKE_HOST_APPLE", "1"); + this->StateSnapshot.SetDefinition("APPLE", "1"); + this->StateSnapshot.SetDefinition("CMAKE_HOST_APPLE", "1"); #endif char temp[1024]; sprintf(temp, "%d", cmVersion::GetMinorVersion()); - this->AddDefinition("CMAKE_MINOR_VERSION", temp); + this->StateSnapshot.SetDefinition("CMAKE_MINOR_VERSION", temp); sprintf(temp, "%d", cmVersion::GetMajorVersion()); - this->AddDefinition("CMAKE_MAJOR_VERSION", temp); + this->StateSnapshot.SetDefinition("CMAKE_MAJOR_VERSION", temp); sprintf(temp, "%d", cmVersion::GetPatchVersion()); - this->AddDefinition("CMAKE_PATCH_VERSION", temp); + this->StateSnapshot.SetDefinition("CMAKE_PATCH_VERSION", temp); sprintf(temp, "%d", cmVersion::GetTweakVersion()); - this->AddDefinition("CMAKE_TWEAK_VERSION", temp); - this->AddDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion()); + this->StateSnapshot.SetDefinition("CMAKE_TWEAK_VERSION", temp); + this->StateSnapshot.SetDefinition("CMAKE_VERSION", + cmVersion::GetCMakeVersion()); - this->AddDefinition("CMAKE_FILES_DIRECTORY", + this->StateSnapshot.SetDefinition("CMAKE_FILES_DIRECTORY", cmake::GetCMakeFilesDirectory()); } -- cgit v0.12