diff options
author | Patrick Gansterer <paroga@paroga.com> | 2010-08-22 19:23:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-08-26 20:39:01 (GMT) |
commit | ef4394defa22ba4288731ae65285c2f33e9e360a (patch) | |
tree | 09d288877891df1cef4e702b40ec263d0dd75596 | |
parent | 4fec681fa7cdc89a4aa40c95fa0156c566ff8722 (diff) | |
download | CMake-ef4394defa22ba4288731ae65285c2f33e9e360a.zip CMake-ef4394defa22ba4288731ae65285c2f33e9e360a.tar.gz CMake-ef4394defa22ba4288731ae65285c2f33e9e360a.tar.bz2 |
VS: Add ArchitectureId to VS 8 and 9 generators
Avoid duplicate architecture string literals.
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Win64Generator.cxx | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio9Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio9Win64Generator.cxx | 3 |
5 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index c4de91e..2612a08 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -21,6 +21,7 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() { this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->ArchitectureId = "X86"; } //---------------------------------------------------------------------------- @@ -55,8 +56,8 @@ void cmGlobalVisualStudio8Generator //---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) { - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86"); + mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId); + mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId); mf->AddDefinition("MSVC80", "1"); } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index ceee53b..e0d5d80 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -78,5 +78,7 @@ protected: virtual void WriteProjectConfigurations(std::ostream& fout, const char* name, bool partOfDefaultBuild); + + const char* ArchitectureId; }; #endif diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx index ea2c65f..3469b17 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -19,6 +19,7 @@ cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator() { + this->ArchitectureId = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -47,6 +48,4 @@ void cmGlobalVisualStudio8Win64Generator { this->cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf); mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64"); } diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 98acf0f..f8ceea0 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -25,8 +25,8 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio9Generator::AddPlatformDefinitions(cmMakefile* mf) { - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86"); + mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId); + mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId); mf->AddDefinition("MSVC90", "1"); } diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx index 67c0bf6..ff4fd4f 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx @@ -16,6 +16,7 @@ cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator() { + this->ArchitectureId = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -44,6 +45,4 @@ void cmGlobalVisualStudio9Win64Generator { cmGlobalVisualStudio9Generator::AddPlatformDefinitions(mf); mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64"); } |